Skip to content

Add ability to customize worker prefix#157

Open
IanButterworth wants to merge 5 commits intomasterfrom
ib/worker_output_customization
Open

Add ability to customize worker prefix#157
IanButterworth wants to merge 5 commits intomasterfrom
ib/worker_output_customization

Conversation

@IanButterworth
Copy link
Member

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.19%. Comparing base (d439c24) to head (48fc61d).

Files with missing lines Patch % Lines
src/cluster.jl 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
- Coverage   79.47%   79.19%   -0.29%     
==========================================
  Files          10       10              
  Lines        1959     1966       +7     
==========================================
  Hits         1557     1557              
- Misses        402      409       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The worker_output_hook API documents that ident is passed as
AbstractString, but the connect function in managers.jl was passing
the pid as an Int. This caused hooks that expected strings (e.g.,
using tryparse(Int, ident)) to fail silently.

Match the behavior in cluster.jl which already passes "$pid".
@IanButterworth IanButterworth marked this pull request as ready for review December 18, 2025 03:23
@IanButterworth IanButterworth changed the title WIP: Add ability to customize worker prefix Add ability to customize worker prefix Dec 18, 2025
Copy link
Member

@JamesWrigley JamesWrigley left a comment

Choose a reason for hiding this comment

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

end
```
"""
const worker_output_hook = Ref{Union{Nothing, Function}}(nothing)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think I like that we expect the handler to fully take over the role of printing stuff as well. We may very well change it in the future to better support logging or something, so I would prefer that the callback instead be a transform that takes in the string and returns a (possibly different) string for Distributed to handle in its own way.

In which case we could have:

Suggested change
const worker_output_hook = Ref{Union{Nothing, Function}}(nothing)
worker_output_hook::Function = identity

@JamesWrigley
Copy link
Member

Regarding the design in JuliaParallel/DistributedNext.jl#17, I'm not sure if we should support per-module callbacks. I could maybe see it being useful if a higher-level tool like Dagger wanted to customize the output a bit more (CC @jpsamaroo).

@JamesWrigley
Copy link
Member

I would also be ok with keeping this a strictly internal feature for the Julia tests 🤷

@DilumAluthge
Copy link
Member

If we keep it internal and non-public, then we have the added benefit of being able to make breaking changes to it (or even remove it entirely) in the future.

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