-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
I discovered today that the fix for #528 might have affected line output buffering in Python 2.7 and possibly Python 3.6. This can be a problem when clush commands are piped to other tools like grep.
Reproducer below. I'm using lctl mark to display a debug marker in syslog while clush | grep is running.
In Python 2.7.5 (EL7), it only works if PYTHONUNBUFFERED is set to 1 (ugly).
# clush -w oak-h05v[06,16-17] journalctl -n0 -fk | grep MARKER
<nothing... this is the bug>
# PYTHONUNBUFFERED=1 clush -w oak-h05v[06,16-17] journalctl -n0 -fk | grep MARKER
oak-h05v06: Dec 02 18:42:24 oak-h05v06.sunet kernel: Lustre: DEBUG MARKER: Tue Dec 2 18:42:24 2025
...
In Python 3.9.18 (EL9), we're good by default:
# clush -w elm-rcf-mr-h[01-04]s01 journalctl -n0 -fk | grep MARKER
elm-rcf-mr-h01s01: Dec 02 18:46:38 elm-rcf-mr-h01s01 kernel: Lustre: DEBUG MARKER: Tue Dec 2 18:46:38 2025
Not sure how much effort we want to put into fixing this as nobody has reported it and Python 2.7/3.6 are both quite old.
The impacted code is likely here:
clustershell/lib/ClusterShell/CLI/Display.py
Line 119 in 0cc8cc2
| # GH#528 enable line buffering |
Metadata
Metadata
Assignees
Labels
No labels