Skip to content

Fix AlternatorLiveNodes thread lifecycle#75

Merged
dkropachev merged 1 commit intomainfrom
fix/alternator-live-nodes-thread-lifecycle
Mar 4, 2026
Merged

Fix AlternatorLiveNodes thread lifecycle#75
dkropachev merged 1 commit intomainfrom
fix/alternator-live-nodes-thread-lifecycle

Conversation

@dkropachev
Copy link
Collaborator

@dkropachev dkropachev commented Mar 4, 2026

Summary

  • Add proper shutdown mechanism to AlternatorLiveNodes background thread
  • Fix infinite loop without shutdown coordination
  • Add graceful termination methods

Changes

  • Add shutdownRequested AtomicBoolean flag for coordinated shutdown
  • Add public shutdown() method to initiate thread termination
  • Add isRunning() method to check thread status
  • Update run() loop to check shutdown flag instead of infinite loop
  • Restore interrupted status when thread receives InterruptedException

Test plan

  • Verify compilation passes
  • Test thread can be shut down gracefully via shutdown() method
  • Verify thread terminates when interrupt is called
  • Check that running status is tracked correctly

@dkropachev dkropachev force-pushed the fix/alternator-live-nodes-thread-lifecycle branch from 9289528 to d56a187 Compare March 4, 2026 14:53
Add proper shutdown mechanism to the background thread:
- Add shutdownRequested AtomicBoolean to signal graceful shutdown
- Add public shutdown() method to initiate thread termination
- Add isRunning() method to check thread status
- Restore interrupted status when thread is interrupted
- Update run() loop to check shutdown flag

Fixes issue where background daemon thread could not be terminated
cleanly during application shutdown.
@dkropachev dkropachev force-pushed the fix/alternator-live-nodes-thread-lifecycle branch from d56a187 to afe8dc8 Compare March 4, 2026 19:29
@dkropachev dkropachev merged commit ef3297a into main Mar 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant