Skip to content

Conversation

@fweilun
Copy link

@fweilun fweilun commented Jan 17, 2026

Changes:

main.go

  • Add sync.WaitGroup for graceful shutdown.
  • Handle SIGINT / SIGTERM to trigger graceful shutdown for all components.

eventserver.go

  • Remove internal signal handling
  • Pass a stop channel into InitServer so lifecycle is controlled by the caller.
  • Flush pending events and stop background routines when shutdown is triggered.

Related issue number

#4392

Testing Strategy

  • tested using:
./output/bin/collector \
  --role=Head \
  --runtime-class-name=localtest \
  --ray-cluster-name=my-cluster \
  --ray-root-dir=/tmp/ray-logs

Graceful shutdown was verified by sending SIGINT (Ctrl+C).

@fweilun
Copy link
Author

fweilun commented Jan 17, 2026

@Future-Outlier could you please take a look at this PR, Thanks.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

The collector.go still has its own signal.Notify which conflicts with main.go. Please follow the graceful shutdown pattern in historyserver/pkg/historyserver/server.go - it only listens to the stop channel without any signal handling.

@Future-Outlier
Copy link
Member

cc @machichima @win5923 to help review

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.

2 participants