Skip to content

Retain NeoForge reward tasks through shutdown - #1772

Draft
BenCodez wants to merge 2 commits into
masterfrom
neoforge/scheduler-close-fence-72
Draft

BenCodez wants to merge 2 commits into
masterfrom
neoforge/scheduler-close-fence-72

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

A NeoForge tick can remove a reward task from the queue just before shutdown drains it. That selected task could still execute after close, or be rejected only after replay/storage teardown and leave a durable uncertainty fence despite no reward having run.

Keep scheduler ownership after dequeue and reject every unstarted task during close, before replay and storage stop. Serialize active task execution with close, preserve reentrant scheduler shutdown, and finish late callback registration on the replay worker when shutdown rejects another dispatch. Aggregate completed replay results without requiring a new executor task after shutdown.

This is limited to NeoForge scheduler/replay lifecycle handling. Configuration, commands, dependencies, storage formats, transport protocols and other platform code are unchanged. A never-started reward retains its original pending vote ID and can replay after restart; accounting and completion receipts still fence duplicate processing. Existing uncertainty handling for an action that may have executed is retained.

Validation at 4d99e8e2b0a4dc57e576cabbfcc7507bec2deaeb: 67 focused tests pass; clean Maven package passes 3,375 unit tests (one skip) and eight artifact checks, with zero failures/errors. Regressions cover deterministic dequeue-before-close cancellation, multiple selected/queued tasks, full runtime shutdown before tick resumption, late callback registration, reentrant close, SQLite restart replay and one accounting completion across subsequent restart. The original scheduler test failed before the fix; the full-shutdown regression also reproduced the first implementation's late-rejection defect, now corrected. Fresh independent full source/disclosure review reports no findings.

Fresh JAR SHA-256: a5a6594bc0f20ec86eeb532eb0ac72084aa70d7da7ea09f218036487e1da0817; 11,129,167 bytes, above the advisory 10 MiB target. Tests use JVM scheduler seams, real SQLite and injected actions. Native NeoForge/server/proxy acceptance has not run and remains separate. Exact-head hosted Maven and CodeQL checks pass. Hosted CodeRabbit review was rate-limited; its neutral status is not a completed review.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12ddc495-c417-4823-9eb7-a090cfb4739b
Commits

Reviewing files that changed from the base of the PR and between 789cae1 and 4d99e8e.

Files selected for processing: 4

  • VotingPlugin/src/main/java/com/bencodez/votingplugin/neoforge/NeoForgeRewardReplayService.java
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/neoforge/NeoForgeServerScheduler.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/neoforge/NeoForgeRewardReplayServiceTest.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/neoforge/NeoForgeServerSchedulerShutdownTest.java
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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.

1 participant