Repository navigation
Conversation
3for
reviewed
Oct 13, 2026
3for
approved these changes
Oct 13, 2026
halibobo1205
approved these changes
Oct 13, 2026
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.
What does this PR do?
Fixes a race in
ComputeRewardTest.query()that can terminate the Gradle test worker while the test closes its database. After verifying the initial reward query, the test shuts down the reward executor and asserts that it terminates within 10 seconds before modifying or closingRewardViStore.The existing reward-value and expected-
TronErrorassertions remain in place. If the background task does not finish within the bound, the test fails before performing those store operations.Why are these changes required?
RewardViCalService.clearUp()releases its completion latch beforecalcMerkleRoot()finishes. Consequently,queryReward()can return while the background task still uses the store. The test then manually invokes calculation paths and closes the store to exercise error handling, without waiting for that background task to finish.In the captured Debian/JDK 8 failure, the background calculation accessed the closed LevelDB, raised
REWARD_VI_CALCULATOR, and triggeredSystem.exit(1). The test's synchronousassertThrowscould not intercept an error from another thread, so the test could report success while its worker exited abnormally.A separate run of the same test recorded overlapping Merkle-root calculations, store closure,
pthread lock: Invalid argument, and worker exit 134. This is consistent with the same store-lifetime race, although no native stack trace was available to identify the exact failing call.shutdown()alone does not wait for an in-flight task. The termination assertion establishes the required ordering between background calculation and the test's store operations.This PR has been tested by:
ComputeRewardTest.query()on JDK 17 / ARM64, with test-result reuse, build cache, and automatic test retries disabled; all passed.checkstyleMainandcheckstyleTest: passed. Semgrep on the changed test: zero findings.Follow up
Monitor the regular CI configuration for recurrence of test-worker exits, particularly native exit 134.
Extra details
Targets
release_v4.8.3. This is a Java 8-compatible, test-only change. The existing 60-second test timeout is preserved; the diagnostic workflow and JVM configuration changes from #7024 are not included.