swuferhong commented on code in PR #3429:
URL: https://github.com/apache/fluss/pull/3429#discussion_r3360682115
##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/rebalance/RebalanceManager.java:
##########
@@ -302,6 +367,8 @@ public RebalanceTask generateRebalanceTask(List<Goal>
goalsByPriority) {
private void processNewRebalanceTask() {
TableBucket tableBucket = inProgressRebalanceTasksQueue.peek();
if (tableBucket != null &&
inProgressRebalanceTasks.containsKey(tableBucket)) {
+ inflightTaskBucket = tableBucket;
+ inflightTaskStartMs = clock.milliseconds();
Review Comment:
Good catch on the ordering fragility. Fixed by applying the volatile
publication idiom — `inflightTaskBucket ` now acts as the "gate" variable:
written last when setting, cleared first when resetting. The timeout checker
reads it first, so JMM happens-before guarantees it always sees a consistent
(bucket, startMs) pair. Added comments documenting the contract.
--
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]