fix(vm): clear leftover thread-local VMConfig snapshot - #16
Closed
vividctrlalt wants to merge 4 commits into
Closed
Conversation
2 tasks
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
Fix intermittent
:framework:testfailures on Rocky Linux JDK 8 after tronprotocol#6857.The same commit is green on Debian 11 JDK 8, Ubuntu, and macOS. London / Osaka tests fail because
initAllowTvm*()writesglobalSnapshotwhilecurrent()still reads a leftover thread-local snapshot. Assertions are unchanged.Root cause
tronprotocol#6857 split VM config into a process-global snapshot (block processing) and a thread-local snapshot (constant calls). Getters use
current()(local if present).initAllowTvm*()still mutates only the global snapshot.ConfigLoader.disableskipsload(), so a leftover local view is never cleared. WithforkEvery = 100, the next test on the same thread does not observe the flags it just set.VMConfigIsolationTestdoes not cover this contract. Pre-tronprotocol#6857 tests (AllowTvmLondonTest,ValidateMultiSignContractTest) still useinit*.Rocky Linux reproduces it more often because the host is slower. A failed-job rerun going green is expected.
Separate races on the same host:
BackupServer.close()could run before bind and calledstop()before closing the UDP channel (channelwas not volatile; port probe was TCP-only).TransactionsMsgHandlerTestusedwhen(mock.foo())whilehandleTransactioncalledisBadPeer()on the same mock.Changes
ConfigLoader.load: whendisableis set,clearLocalSnapshot()soinit*is visible tocurrent().ConfigLoader.disable.BackupServer: volatilechannel, close the channel beforebackupManager.stop(), close-if-shutdown after bind; wait for bind instead ofsleep(1000);chooseRandomPortprobes UDP.TransactionsMsgHandlerTest:doReturnand a fresh peer mock per case.Related
tronprotocol#6857
Test plan
./gradlew :framework:test --tests org.tron.common.runtime.vm.AllowTvmLondonTest --tests org.tron.common.runtime.vm.ValidateMultiSignContractTest --tests org.tron.common.backup.BackupServerTest --tests org.tron.core.net.messagehandler.TransactionsMsgHandlerTest:framework:teston Rocky Linux JDK 8