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

Adjust heartbeat behavior #180

Open
wants to merge 6 commits into
base: v1.10.2+RAI
Choose a base branch
from
Open

Adjust heartbeat behavior #180

wants to merge 6 commits into from

Conversation

kpamnany
Copy link
Collaborator

@kpamnany kpamnany commented Sep 18, 2024

PR Description

Introduce a heartbeat pause/resume capability. Use this capability:

  • during GC (so that long GC pauses do not cause heartbeat losses), and
  • when a thread that is not the heartbeat thread prints task backtraces.

Checklist

Requirements for merging:

`jl_print_task_backtraces()` can take long enough that there can
be heartbeat loss, which can trigger printing task backtraces
again, unless it is called from the heartbeat thread which takes
care of that possible problem.
@github-actions github-actions bot added port-to-v1.10 This change should apply to Julia v1.10 builds port-to-master This change should apply to all future Julia builds labels Sep 18, 2024
Copy link
Member

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +1179 to +1181
if (!jl_inside_heartbeat_thread()) {
jl_heartbeat_pause();
}
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Why the if-check?

If a heartbeat loss causes us to print backtraces, could the backtraces we're printing cause another heartbeat loss?

I think I remember you said the answer is "no" when we discussed over zoom, but it would be nice to clarify that in the comments, here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought I'd written that up. Sorry, I'll add a comment. If this is called from the heartbeat thread, there will be no additional heartbeat loss because it is the heartbeat thread itself that determines whether there is heartbeat loss. So when it returns from here, the counter for heartbeats missed is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-to-master This change should apply to all future Julia builds port-to-v1.10 This change should apply to Julia v1.10 builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants