Skip to content

Write heartbeat thread output to safe crash log#155

Merged
kpamnany merged 3 commits intov1.10.2+RAIfrom
kp-hb-safe-log
May 27, 2024
Merged

Write heartbeat thread output to safe crash log#155
kpamnany merged 3 commits intov1.10.2+RAIfrom
kp-hb-safe-log

Conversation

@kpamnany
Copy link
Copy Markdown

@kpamnany kpamnany commented May 27, 2024

PR Description

Re-land #153.

Checklist

Requirements for merging:

  • I have opened an issue or PR upstream on JuliaLang/julia: <link to JuliaLang/julia>
  • I have removed the port-to-* labels that don't apply.
  • I have opened a PR on raicode to test these changes:

kpamnany added 3 commits May 24, 2024 12:11
To allow `jl_safe_printf()` to determine whether it's being called
from the heartbeat thread.
In `jl_safe_printf()`, we're already writing to the safe crash log
if we're in signal handler context (in addition to writing to
`stderr`). Now we do the same if we're in the heartbeat thread.
Concurrent `write()` calls to the same file descriptor should be
thread-safe, but can result in interleaving. Refactor the JSON
printing code used from `jl_safe_printf()` to assemble the message
into a buffer and use a single `write()` call.
@github-actions github-actions bot added port-to-v1.10 port-to-v1.12 This change should apply to Julia v1.12 builds labels May 27, 2024
@kpamnany kpamnany merged commit 3f82711 into v1.10.2+RAI May 27, 2024
@kpamnany kpamnany deleted the kp-hb-safe-log branch May 27, 2024 19:39
Drvi pushed a commit that referenced this pull request Jun 7, 2024
* Add `jl_inside_heartbeat_thread()`

To allow `jl_safe_printf()` to determine whether it's being called
from the heartbeat thread.

* Write heartbeat thread output to the safe crash log

In `jl_safe_printf()`, we're already writing to the safe crash log
if we're in signal handler context (in addition to writing to
`stderr`). Now we do the same if we're in the heartbeat thread.

* Refactor JSON printing code

Concurrent `write()` calls to the same file descriptor should be
thread-safe, but can result in interleaving. Refactor the JSON
printing code used from `jl_safe_printf()` to assemble the message
into a buffer and use a single `write()` call.
Drvi pushed a commit that referenced this pull request Jun 7, 2024
* Add `jl_inside_heartbeat_thread()`

To allow `jl_safe_printf()` to determine whether it's being called
from the heartbeat thread.

* Write heartbeat thread output to the safe crash log

In `jl_safe_printf()`, we're already writing to the safe crash log
if we're in signal handler context (in addition to writing to
`stderr`). Now we do the same if we're in the heartbeat thread.

* Refactor JSON printing code

Concurrent `write()` calls to the same file descriptor should be
thread-safe, but can result in interleaving. Refactor the JSON
printing code used from `jl_safe_printf()` to assemble the message
into a buffer and use a single `write()` call.
@d-netto d-netto removed the port-to-v1.12 This change should apply to Julia v1.12 builds label Jan 30, 2025
nickrobinson251 pushed a commit that referenced this pull request Feb 26, 2025
* Add `jl_inside_heartbeat_thread()`

To allow `jl_safe_printf()` to determine whether it's being called
from the heartbeat thread.

* Write heartbeat thread output to the safe crash log

In `jl_safe_printf()`, we're already writing to the safe crash log
if we're in signal handler context (in addition to writing to
`stderr`). Now we do the same if we're in the heartbeat thread.

* Refactor JSON printing code

Concurrent `write()` calls to the same file descriptor should be
thread-safe, but can result in interleaving. Refactor the JSON
printing code used from `jl_safe_printf()` to assemble the message
into a buffer and use a single `write()` call.
github-actions bot pushed a commit that referenced this pull request Apr 4, 2026
Stdlib: Distributed
URL: https://github.com/JuliaLang/Distributed.jl
Stdlib branch: master
Julia branch: master
Old commit: cd92195
New commit: d439c24
Julia version: 1.14.0-DEV
Distributed version: 1.11.0 (Does not match)
Bump invoked by: @DilumAluthge
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Distributed.jl@cd92195...d439c24

```
$ git log --oneline cd92195..d439c24
d439c24 CI: Add a CI job that runs JET tests (#164)
d396a8c Fix some JET errors around matching methods for `send_connection_hdr(...)` and `send_msg_now(...)` (#180)
231da28 Fix some JET errors around matching methods for `kill(...)` and `process_exited(...)` (#172)
2adcd26 Rename one method of `run_work_thunk()` to `run_work_thunk_remotevalue()`; this fixes a JET error around matching methods for `run_work_thunk(...)` (#181)
1bc91f9 Fix a JET error regarding the existence of the local variable `reducer` at a certain point (#169)
b7c43b2 Fix a JET error around matching methods for `push!(...)` (#173)
d06aa73 Fix a JET error around matching methods for `getindex(...)` (#170)
0cf9910 Fix a JET error around matching methods for `read_worker_host_port(...)` (#171)
9f6459f Fix JET errors around matching methods for `lock(...)` and `unlock(...)` (#167)
9724553 Fix a JET error around matching methods for `shell_escape_wincmd(...)` (#174)
d65a996 Fix a JET error by narrowing the type signature of the `create_worker(x, y)` function (#175)
3ebddd3 avoid `Core.Box` in the package (#161)
2fe1aa4 Change `Distributed.cluster_manager` from a global non-constant `ClusterManager` to a global constant `Ref{ClusterManager}` (#177)
6649a94 Ensure correct type parameter of serialized RemoteChannel (#179)
871e3d7 Fix JET errors around matching methods for `send_msg_now(...)` (#165)
56fa9f2 Fix JET errors around matching methods for `send_msg(...)` (#166)
a6195c0 Bump actions/checkout from 5 to 6 (#155)
```

Co-authored-by: DilumAluthge <5619885+DilumAluthge@users.noreply.github.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.

3 participants