Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue with forkjoin #1245

Merged
merged 1 commit into from
Mar 31, 2024
Merged

fix issue with forkjoin #1245

merged 1 commit into from
Mar 31, 2024

Conversation

pjfanning
Copy link
Contributor

relates to #485

The method handle seemed to work in my testing but today, I am seeing issues.

This change fixes the issues I have seen.

This was the exception I got and that no longer happens with this PR change.

[error] java.lang.invoke.WrongMethodTypeException: expected (int,ForkJoinWorkerThreadFactory,int,UncaughtExceptionHandler,boolean)PekkoJdk9ForkJoinPool but found (int,ForkJoinWorkerThreadFactory,int,UncaughtExceptionHandler,boolean)Object
[error] 	at java.base/java.lang.invoke.Invokers.newWrongMethodTypeException(Invokers.java:476)
[error] 	at java.base/java.lang.invoke.Invokers.checkExactType(Invokers.java:485)
[error] 	at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$ForkJoinExecutorServiceFactory.createExecutorService(ForkJoinExecutorConfigurator.scala:122)
[error] 	at org.apache.pekko.dispatch.Dispatcher$LazyExecutorServiceDelegate.executor$lzycompute(Dispatcher.scala:54)

Copy link
Member

@He-Pin He-Pin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@pjfanning pjfanning merged commit 276a757 into apache:main Mar 31, 2024
18 checks passed
@He-Pin
Copy link
Member

He-Pin commented Mar 31, 2024

Great, as the invoke will do type conversations when type not match exactly

@pjfanning pjfanning deleted the forkjoin-issue branch March 31, 2024 17:13
@pjfanning
Copy link
Contributor Author

pjfanning commented Mar 31, 2024

Great, as the invoke will do type conversations when type not match exactly

I rarely find that invokeExact actually works. I'm finding in most cases that I need to use invoke anyway. I'm talking about other cases where I use MethodHandles, not necessarily in Pekko.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants