Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix][Core] Wait a while before stopping the ray_print_logs thread to prevent pending logs #49337

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MortalHappiness
Copy link
Member

@MortalHappiness MortalHappiness commented Dec 18, 2024

Why are these changes needed?

If the job finishes first but the job submitter hasn't completed polling all the logs, the polling thread being set as a daemon thread may result in some pending logs (logs from the worker running this job that haven't been polled yet) not being printed. This PR changes the print log thread to a regular thread and ensures it only returns after the size of the message queue drops to lower than or equal to 1.

Related issue number

Closes: #48701

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@MortalHappiness MortalHappiness marked this pull request as draft December 18, 2024 17:16
@MortalHappiness MortalHappiness force-pushed the bugfix/#48701-ray-job-submit-incomplete-log branch 2 times, most recently from f42a164 to 2586dc1 Compare December 18, 2024 17:34
@MortalHappiness MortalHappiness marked this pull request as ready for review December 18, 2024 17:34
@MortalHappiness MortalHappiness added the go add ONLY when ready to merge, run all tests label Dec 18, 2024
@MortalHappiness MortalHappiness force-pushed the bugfix/#48701-ray-job-submit-incomplete-log branch from 2586dc1 to 9594db8 Compare December 18, 2024 17:35
@MortalHappiness MortalHappiness force-pushed the bugfix/#48701-ray-job-submit-incomplete-log branch from 9594db8 to 57cdb10 Compare December 18, 2024 17:47
@MortalHappiness MortalHappiness marked this pull request as draft December 18, 2024 23:01
@MortalHappiness MortalHappiness force-pushed the bugfix/#48701-ray-job-submit-incomplete-log branch 5 times, most recently from 588c244 to 9a07cff Compare December 19, 2024 15:36
@MortalHappiness MortalHappiness force-pushed the bugfix/#48701-ray-job-submit-incomplete-log branch from 9a07cff to d0cbd3d Compare December 19, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] ray job submit doesn't always catch the last lines of the job logs
2 participants