JDK 17+ compatibility: JCTools 4.x, suppress deprecation warnings, expand CI matrix#6
Open
halotukozak wants to merge 3 commits intoseries/3.x-avsfrom
Open
JDK 17+ compatibility: JCTools 4.x, suppress deprecation warnings, expand CI matrix#6halotukozak wants to merge 3 commits intoseries/3.x-avsfrom
halotukozak wants to merge 3 commits intoseries/3.x-avsfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Monix’s build/tooling and CI to improve compatibility with newer JDKs (incl. JDK 25), modernizes GitHub Actions, and bumps key build dependencies (including JCTools).
Changes:
- Bumped build tooling and plugins (SBT 1.10.7, sbt plugins, scalac/tpolecat configuration) and updated JCTools to 4.0.5.
- Replaced
Unsafe.fullFence()usage withVarHandle.fullFence()in two JVM queue adapters. - Modernized CI workflows (actions v4,
ubuntu-latest, expanded JVM test matrix to JDK 8/11/21/25).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| project/plugins.sbt | Updates sbt plugin versions; adds a dependency scheme override for geny. |
| project/build.properties | Bumps sbt version to 1.10.7. |
| monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala | Suppresses an exhaustivity warning for a list destructure. |
| monix-execution/jvm/src/main/scala/monix/execution/internal/collection/queues/FromMessagePassingQueue.scala | Switches fencing implementation to VarHandle.fullFence(). |
| monix-execution/jvm/src/main/scala/monix/execution/internal/collection/queues/FromCircularQueue.scala | Switches fencing implementation to VarHandle.fullFence(). |
| build.sbt | Bumps versions (JCTools, plugins) and adjusts scalac/tpolecat options. |
| .jvmopts | Removes a deprecated JVM option (CMSClassUnloadingEnabled). |
| .gitignore | Ignores .planning/. |
| .github/workflows/build.yml | Modernizes actions/runners; expands JVM matrix and updates Scala versions. |
Comments suppressed due to low confidence (1)
.github/workflows/build.yml:104
- Node.js 14 is end-of-life and may eventually stop being available on GitHub-hosted runners / receive security updates. Since this workflow is being modernized, consider bumping
node-versionto a supported LTS (e.g. 18 or 20) unless Scala.js tooling here explicitly requires 14.
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 14
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../jvm/src/main/scala/monix/execution/internal/collection/queues/FromMessagePassingQueue.scala
Outdated
Show resolved
Hide resolved
...cution/jvm/src/main/scala/monix/execution/internal/collection/queues/FromCircularQueue.scala
Outdated
Show resolved
Hide resolved
…ix expansion - Upgrade JCTools from 3.3.0 to 4.0.5 - Add Java 17, 21, 25 to CI build matrix - Add @nowarn("msg=deprecated") for Thread.getId (deprecated since JDK 19) in Platform, DynamicWorkerThreadFactory, StandardWorkerThreadFactory, ThreadFactoryBuilder - Add @nowarn("msg=deprecated") for sun.misc.Unsafe usage in FromMessagePassingQueue and FromCircularQueue - Add -Wconf:cat=unused-nowarn:s to suppress unused @nowarn on JDK 11
c7dc5f8 to
a7a540d
Compare
Ensure reliable scheduling by using Monix's ScheduledExecutorService for ForkJoinPool, addressing differences in exception handling and task scheduling.
mikkolaj
reviewed
Mar 27, 2026
Comment on lines
+103
to
+109
| case _: ForkJoinPool => | ||
| // ForkJoinPool implements ScheduledExecutorService since JDK 25, | ||
| // but its scheduling behavior differs from ScheduledThreadPoolExecutor | ||
| // (e.g. exception handling in scheduled tasks). Use the simple executor | ||
| // path with Monix's own ScheduledExecutorService for reliable scheduling. | ||
| val s = Defaults.scheduledExecutor | ||
| new FromSimpleExecutor(s, service, reporter, executionModel, ft) |
There was a problem hiding this comment.
This fixes error reporting for ForkJoinPool, but I think case ref: ScheduledExecutorService => branch is still broken. Try adding this test suite:
object ScheduledExecutorSuite extends ExecutorSchedulerSuite {
def setup(): SchedulerService =
monix.execution.Scheduler(Executors.newSingleThreadScheduledExecutor(), reporter = testsReporter)
}
For me it fails the same way ForkJoinPool did before the fix.
…uler" This reverts commit 61732f3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dependencies
CI
Deprecation suppressions
Add
@nowarn("msg=deprecated")to suppress warnings that appear on newer JDKs but are absent on JDK 11:Thread.getId(deprecated since JDK 19) —Platform,DynamicWorkerThreadFactory,StandardWorkerThreadFactory,ThreadFactoryBuildersun.misc.Unsafe—FromMessagePassingQueue,FromCircularQueue-Wconf:cat=unused-nowarn:sinbuild.sbtto prevent the above@nowarnannotations from being flagged as unused on JDK 11Test plan
sbt +compilepasses on all Scala versionssbt +testpasses (JVM)🤖 Generated with Claude Code