pilichoumao opened a new pull request, #6521: URL: https://github.com/apache/rocketmq-dashboard/pull/6521
### Which Issue(s) This PR Fixes Fixes #6513. ### Brief Description Concurrent context mutation commands can read the same snapshot and both report success while the later Save discards an earlier update. Introduce an internal Store.Update transaction and route set-context/use-context/delete-context through it. Load the latest document only after obtaining a native exclusive lock, keep it through validation and atomic Save, and release it on every return. The stable private sidecar survives config renames and process exits; waiting is bounded to 30 seconds and respects Ctrl-C. Normalize parent-directory aliases, fail closed on invalid locks, and preserve the existing Save replacement contract, output, YAML validation and environment-reference credentials. Add macOS/Windows config runtime CI and document cooperating-writer/local-filesystem limitations. This is a draft for the design discussion in #6513. Maintainer agreement on the lock dependency and policy is pending, per CONTRIBUTING's requirement to discuss non-trivial designs before landing them. ### How Did You Test This Change? - Actual production command handlers run in independent child processes: all three mutations bypass a held lock with unchanged command code; fixed commands wait and preserve an update committed before unlock. Repeated three times with race detection on macOS and Linux ECS. - Store tests cover callback/validation/YAML rollback, cancellation/deadlines, directory aliases, invalid/private lock files and release after process death. - macOS Go 1.27.1: `make fmt catalog-verify test-race vet build build-all` passed. All six targets (Linux/macOS/Windows amd64/arm64) built and their binary-specific license materials verified, including the new flock dependency and Windows-only x/sys. - macOS production binary: three rounds of eight simultaneous set-context commands retained every context and only credential references. - ECS Linux Go 1.27.1: `make fmt catalog-verify test-race vet build` passed, including binary license material verification. Three rounds of eight concurrent production binaries retained every context and credential reference. - Windows binaries cross-built; Windows runtime tests are added to CI and have not yet been observed passing. No network filesystem, backend or live Studio tests were run. ### Checklist - [x] One coherent change - [x] Conventional commit subject - [x] Meaningful process regression and lifecycle tests - [x] No new frontend text (not applicable) - [ ] Backend/ArchUnit checks (not run; backend unchanged) - [x] New sources carry ASF headers - [x] Behavior and locking limitations documented Related work: #6208 verifies atomic whole-document saves. This change retains that behavior and adds serialization around the complete command mutation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
