Skip to content

Conversation

@ivoson
Copy link
Contributor

@ivoson ivoson commented Nov 14, 2025

What changes were proposed in this pull request?

Currently, worker will schedule tasks forwarding SendHeartbeat and WorkDirCleanup while handleRegisterResponse.

While worker registration could happen multiple times in case of heartbeat timeout/disconnected from master, in these cases the tasks would be scheduled multiple times.

To fix the issue:

  • Adding heartbeatTask and workDirCleanupTask in worker to tell whether these tasks have been scheduled
  • heartbeatTask and workDirCleanupTask will be initialized after the 1st registration, and then skipped scheduling these tasks in later registration.
  • Cancel the task and reset heartbeatTask and workDirCleanupTask when worker stops.

Why are the changes needed?

Fix the issue repeatedly scheduling SendHeartbeat/WorkDirClean tasks after worker registration.

Does this PR introduce any user-facing change?

No

How was this patch tested?

UT added

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the CORE label Nov 14, 2025
@ivoson ivoson marked this pull request as ready for review November 14, 2025 02:08
@ivoson
Copy link
Contributor Author

ivoson commented Nov 14, 2025

cc @Ngone51 @LuciferYang @dongjoon-hyun can you please take a look? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant