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

[WIP] Remove deprecated scala.concurrent.forkjoin references #18262 #21101

Closed
wants to merge 1 commit into from

Conversation

NeQuissimus
Copy link

  • Replaced all instances of scala.concurrent.forkjoin.* with their corresponding classes in java.util.concurrent
  • Removed one unused import of ThreadLocalRandom

This work fixed #18262.

Binary compatibility warnings will need to be addressed, copy from the discussion on #18262:

The following methods and type hierarchies are affected

akka.dispatch.BalancingDispatcher$SharingMailbox
akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool.this
akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory.this
akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory.threadFactory
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinPool
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask
akka.dispatch.ForkJoinExecutorConfigurator.validate
akka.dispatch.MonitorableThreadFactory#AkkaForkJoinWorkerThread.this
akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread
akka.dispatch.MonitorableThreadFactory.newThread

Raw log:

[info] akka-actor: found 13 potential binary incompatibilities while checking against com.typesafe.akka:akka-actor_2.11:2.3.15  (filtered 215)
[error]  * method threadFactory()scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory in class akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory has a different result type in current version, where it is java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory rather than scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory.threadFactory")
[error]  * method this(akka.dispatch.ForkJoinExecutorConfigurator,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,Int)Unit in class akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory's type is different in current version, where it is (akka.dispatch.ForkJoinExecutorConfigurator,java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory,Int)Unit instead of (akka.dispatch.ForkJoinExecutorConfigurator,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,Int)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory.this")
[error]  * method this(akka.dispatch.ForkJoinExecutorConfigurator,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,Int,Boolean)Unit in class akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory's type is different in current version, where it is (akka.dispatch.ForkJoinExecutorConfigurator,java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory,Int,Boolean)Unit instead of (akka.dispatch.ForkJoinExecutorConfigurator,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,Int,Boolean)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator#ForkJoinExecutorServiceFactory.this")
[error]  * method validate(java.util.concurrent.ThreadFactory)scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory in class akka.dispatch.ForkJoinExecutorConfigurator has a different result type in current version, where it is java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory rather than scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator.validate")
[error]  * the type hierarchy of class akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinTask is different in current version. Missing types {java.lang.Object,scala.concurrent.forkjoin.ForkJoinTask}
[error]    filter with: ProblemFilters.exclude[MissingTypesProblem]("akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask")
[error]  * method newThread(scala.concurrent.forkjoin.ForkJoinPool)scala.concurrent.forkjoin.ForkJoinWorkerThread in class akka.dispatch.MonitorableThreadFactory in current version does not have a correspondent with same parameter signature among (java.util.concurrent.ForkJoinPool)java.util.concurrent.ForkJoinWorkerThread, (java.lang.Runnable)java.lang.Thread
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.MonitorableThreadFactory.newThread")
[error]  * the type hierarchy of class akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool is different in current version. Missing types {java.util.concurrent.AbstractExecutorService,scala.concurrent.forkjoin.ForkJoinPool}
[error]    filter with: ProblemFilters.exclude[MissingTypesProblem]("akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinPool")
[error]  * method this(Int,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler)Unit in class akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool's type is different in current version, where it is (Int,java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler)Unit instead of (Int,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool.this")
[error]  * method this(Int,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler,Boolean)Unit in class akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool's type is different in current version, where it is (Int,java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler,Boolean)Unit instead of (Int,scala.concurrent.forkjoin.ForkJoinPool#ForkJoinWorkerThreadFactory,java.lang.Thread#UncaughtExceptionHandler,Boolean)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.ForkJoinExecutorConfigurator#AkkaForkJoinPool.this")
[error]  * the type hierarchy of class akka.dispatch.Mailbox is different in current version. Missing types {java.lang.Object}
[error]    filter with: ProblemFilters.exclude[MissingTypesProblem]("akka.dispatch.BalancingDispatcher$SharingMailbox")
[error]  * the type hierarchy of class akka.dispatch.MonitorableThreadFactory#AkkaForkJoinWorkerThread is different in current version. Missing types {java.lang.Thread,scala.concurrent.forkjoin.ForkJoinWorkerThread}
[error]    filter with: ProblemFilters.exclude[MissingTypesProblem]("akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread")
[error]  * method this(scala.concurrent.forkjoin.ForkJoinPool)Unit in class akka.dispatch.MonitorableThreadFactory#AkkaForkJoinWorkerThread's type is different in current version, where it is (java.util.concurrent.ForkJoinPool)Unit instead of (scala.concurrent.forkjoin.ForkJoinPool)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.MonitorableThreadFactory#AkkaForkJoinWorkerThread.this")

@akka-ci
Copy link

akka-ci commented Aug 2, 2016

Can one of the repo owners verify this patch?

@drewhk
Copy link
Member

drewhk commented Aug 3, 2016

OK TO TEST

@akka-ci akka-ci added validating PR is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed validating PR is currently being validated by Jenkins labels Aug 3, 2016
@akka-ci
Copy link

akka-ci commented Aug 3, 2016

Test FAILed.

@NeQuissimus
Copy link
Author

Is your general workflow for you to schedule looking at this internally? I am not quite sure what should happen next :) The MiMa concerns are valid, which makes me think the MiMa exclusions should only be in effect for 2.5.x?!

@patriknw
Copy link
Member

As mentioned in the issue I'm very skeptical to replacing this in a patch release. The behavior or performance profile might have changed. That is too risky to just drop-in to production systems.

Feel free to prove me wrong, but then I would like to see evidence that the implementations are almost identical, and I don't have time to do that investigation myself.

I have no problem switching for Akka 2.5

@NeQuissimus
Copy link
Author

I will do some investigation. Should I find any difference, I will add the MiMa filters for 2.5

@NeQuissimus
Copy link
Author

Looking at the implementations, they do seem to be slightly different. From what I can tell JDK 8 and Scala 2.11 have different versions of JSR166 included, which causes the difference.
It does not look like much but I agree with not wanting to change this in a 2.4.x release.

I will update the PR

@akka-ci akka-ci added validating PR is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) validating PR is currently being validated by Jenkins labels Aug 27, 2016
@akka-ci
Copy link

akka-ci commented Aug 27, 2016

Test FAILed.

@akka-ci akka-ci added validating PR is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) validating PR is currently being validated by Jenkins labels Aug 27, 2016
@akka-ci
Copy link

akka-ci commented Aug 27, 2016

Test FAILed.

@akka-ci akka-ci added validating PR is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) labels Aug 27, 2016
@akka-ci
Copy link

akka-ci commented Aug 27, 2016

Test FAILed.

@akka-ci akka-ci removed the validating PR is currently being validated by Jenkins label Aug 27, 2016
@NeQuissimus
Copy link
Author

This now only fails because we are still building a 2.4.x. I added the MIMA filters for 2.5.0.
A simple rebase against a 2.5.0 master should be enough to make this build pass.

@patriknw
Copy link
Member

Thank you, @NeQuissimus
Since we have not created a branch for 2.5 development yet I will close this PR for now, but mention it's existence in the issue.

@patriknw patriknw closed this Aug 30, 2016
@NeQuissimus
Copy link
Author

Sounds good, I can just re-send it once there is a 2.5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-attention Indicates a PR validation failure (set by CI infrastructure)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update forkjoin related dependencies.
4 participants