Skip to content

Fix logging in parallel tasks after threading change#11

Merged
coleaeason merged 2 commits intomainfrom
cole/fix-logging
Mar 10, 2026
Merged

Fix logging in parallel tasks after threading change#11
coleaeason merged 2 commits intomainfrom
cole/fix-logging

Conversation

@coleaeason
Copy link

@rafecolton Please review. A small bug from the threading change I noticed this morning:

pgab -H "bastion*" -- 'ls'
[INFO] Matched hosts: ["bastion1.lax", "bastion1.rno", "bastion1.sjc"]
[bastion1.lax] Executing task '<remainder>'
[bastion1.rno] Executing task '<remainder>'
[bastion1.sjc] Executing task '<remainder>'
[bastion1.sjc] run: ls
[bastion1.rno] run: ls
[bastion1.lax] run: ls
[None] out: REDACTED
[None] out: REDACTED
[None] out:

Disconnecting from bastion1.sjc ... done.
[None] out: REDACTED
[None] out:

Disconnecting from bastion1.sjc ... done.
Disconnecting from bastion1.rno ... done.
[None] out: REDACTED
[None] out:

Disconnecting from bastion1.sjc ... done.
Disconnecting from bastion1.lax ... done.

Done.

The output from each task is missing the host string.

Fix by passing a thread local copy of the env into the sub thread that runs the task from the parent thread that runs each host connection:

uv run saltfab -P -H 'bastion*' -- 'ls'
[INFO] Matched hosts: ["bastion1.lax", "bastion1.rno", "bastion1.sjc"]
[bastion1.lax] Executing task '<remainder>'
[bastion1.rno] Executing task '<remainder>'
[bastion1.sjc] Executing task '<remainder>'
[bastion1.sjc] run: ls
[bastion1.rno] run: ls
[bastion1.lax] run: ls
[bastion1.lax] out: REDACTED
[bastion1.lax] out:

Disconnecting from bastion1.lax ... done.
[bastion1.rno] out: REDACTED
[bastion1.rno] out:

Disconnecting from bastion1.rno ... done.
[bastion1.sjc] out: REDACTED
[bastion1.sjc] out: REDACTED
[bastion1.sjc] out:

Disconnecting from bastion1.sjc ... done.

Done.

@coleaeason coleaeason requested a review from rafecolton March 10, 2026 14:14
@coleaeason coleaeason self-assigned this Mar 10, 2026
@coleaeason coleaeason changed the title Cole/fix logging Fix logging in parallel tasks after threading change Mar 10, 2026
@coleaeason coleaeason merged commit 56efde7 into main Mar 10, 2026
3 checks passed
@coleaeason coleaeason deleted the cole/fix-logging branch March 10, 2026 14:24
@os-botify
Copy link

os-botify bot commented Mar 10, 2026

🚀 Released in version 1.20.7 🚀

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.

2 participants