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][gcs] Fix task events profile events per task leak #42248

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

rickyyx
Copy link
Contributor

@rickyyx rickyyx commented Jan 9, 2024

Why are these changes needed?

When a long running task keeps submitting tasks (e.g. driver task, actor task), it generates many profile events as part of task submission.

While we already cap the number of profile events in a task at the core worker (where task events are produced and reported), we are not doing that on GCS (the sink), so it's possible when new task events merged to existing ones, it goes unbounded.

Closes #42144

Related issue number

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

Signed-off-by: rickyyx <rickyx@anyscale.com>
Signed-off-by: rickyyx <rickyx@anyscale.com>
@rickyyx rickyyx marked this pull request as ready for review January 9, 2024 00:21
@rickyyx rickyyx requested a review from a team as a code owner January 9, 2024 00:21
@rickyyx
Copy link
Contributor Author

rickyyx commented Jan 9, 2024

As a follow-up, I think we should add explicit memory consumption regression metrics to GCS and other components for our long running tests. #42250

if (existing_task.profile_events().events_size() > max_num_profile_events_per_task) {
auto to_drop =
existing_task.profile_events().events_size() - max_num_profile_events_per_task;
existing_task.mutable_profile_events()->mutable_events()->DeleteSubrange(0, to_drop);
Copy link
Contributor

Choose a reason for hiding this comment

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

if to_drop is negative, it will be noop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will not enter the if clause in this case.

@rickyyx rickyyx merged commit 08c0202 into ray-project:master Jan 9, 2024
9 checks passed
rickyyx added a commit to rickyyx/ray that referenced this pull request Jan 9, 2024
…#42248)

---------

Signed-off-by: rickyyx <rickyx@anyscale.com>
can-anyscale pushed a commit that referenced this pull request Jan 9, 2024
…2268)

When a long running task keeps submitting tasks (e.g. driver task, actor task), it generates many profile events as part of task submission.

While we already cap the number of profile events in a task at the core worker (where task events are produced and reported), we are not doing that on GCS (the sink), so it's possible when new task events merged to existing ones, it goes unbounded.

Signed-off-by: rickyyx <rickyx@anyscale.com>
vickytsang pushed a commit to ROCm/ray that referenced this pull request Jan 12, 2024
…#42248)

---------

Signed-off-by: rickyyx <rickyx@anyscale.com>
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.

[Serve] Memory leak after upgrading from 2.8.1 to 2.9.0
2 participants