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

[core] fix worker launch time formatting #43516

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

hongchaodeng
Copy link
Member

@hongchaodeng hongchaodeng commented Feb 28, 2024

Why are these changes needed?

Timestamp was not set for when triggering the launcher, resulting in default timestamp being set as (int) -1 == (unsigned) 18446744073709551615 (2^64-1)

Related issue number

Closes #35130

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 :(

@anyscalesam anyscalesam added the core Issues that should be addressed in Ray Core label Apr 11, 2024
@anyscalesam anyscalesam requested a review from a team June 11, 2024 23:25
@anyscalesam anyscalesam self-assigned this Jun 11, 2024
python/ray/util/state/common.py Outdated Show resolved Hide resolved
python/ray/util/state/common.py Outdated Show resolved Hide resolved
@@ -93,6 +93,15 @@ def timestamp(x: float):
"""Converts miliseconds to a datetime object."""
return str(datetime.datetime.fromtimestamp(x / 1000))

def timestamp_or_empty(x: int):
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to unify timestamp_or_empty and timestamp into a single method that can take either float or int, valid values and invalid values?

This way user does not need to decide which exact method to call.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@anyscalesam
Copy link
Contributor

@hongchaodeng this PR still relevant; couple feedback points waiting on you.

@anyscalesam anyscalesam added triage Needs triage (eg: priority, bug/not-bug, and owning component) docs An issue or change related to documentation labels Jul 16, 2024
@jjyao jjyao added go add ONLY when ready to merge, run all tests and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jul 17, 2024
Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
Comment on lines 98 to 99
if x == -1:
return ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should do it on the caller side as the caller knows what special value can be so that this method doesn't need to handle -1, None or some other special values

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
@rynewang rynewang merged commit 7044dce into ray-project:master Jul 18, 2024
5 checks passed
@hongchaodeng hongchaodeng deleted the fix-launchtime branch July 18, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core][state] Worker launch time incorrect for driver
5 participants