Skip to content

JDK 17+ compatibility: JCTools 4.x, suppress deprecation warnings, expand CI matrix#6

Open
halotukozak wants to merge 3 commits intoseries/3.x-avsfrom
jdk-25-compat
Open

JDK 17+ compatibility: JCTools 4.x, suppress deprecation warnings, expand CI matrix#6
halotukozak wants to merge 3 commits intoseries/3.x-avsfrom
jdk-25-compat

Conversation

@halotukozak
Copy link
Copy Markdown
Member

@halotukozak halotukozak commented Feb 26, 2026

Summary

Dependencies

  • JCTools 3.3.0 → 4.0.5

CI

  • Expand JVM test matrix: Java 11 → Java 11, 17, 21, 25

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, ThreadFactoryBuilder
  • sun.misc.UnsafeFromMessagePassingQueue, FromCircularQueue
  • -Wconf:cat=unused-nowarn:s in build.sbt to prevent the above @nowarn annotations from being flagged as unused on JDK 11

Test plan

  • CI green on Java 11, 17, 21, 25
  • sbt +compile passes on all Scala versions
  • sbt +test passes (JVM)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 26, 2026 18:59
@halotukozak halotukozak changed the base branch from series/3.x-avs to bump-dependencies February 26, 2026 19:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with VarHandle.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-version to 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.

@halotukozak halotukozak changed the base branch from bump-dependencies to series/3.x-avs February 26, 2026 19:08
@halotukozak halotukozak self-assigned this Feb 26, 2026
@halotukozak halotukozak changed the base branch from series/3.x-avs to bump-dependencies February 26, 2026 19:09
@halotukozak halotukozak changed the title JDK 25 compatibility: JCTools 4.x, VarHandle fencing, CI modernization JDK 25 compatibility: Drop JDK 8 support, JCTools 4.x, VarHandle fencing, CI modernization Feb 27, 2026
mikkolaj

This comment was marked as outdated.

Base automatically changed from bump-dependencies to series/3.x-avs March 27, 2026 09:35
…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
@halotukozak halotukozak changed the title JDK 25 compatibility: Drop JDK 8 support, JCTools 4.x, VarHandle fencing, CI modernization JDK 17+ compatibility: JCTools 4.x, suppress deprecation warnings, expand CI matrix Mar 27, 2026
Ensure reliable scheduling by using Monix's ScheduledExecutorService for ForkJoinPool, addressing differences in exception handling and task scheduling.
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

3 participants