fix: stdbuf -oL on the tr pipe (1.0.0-58)
1.0.0-57's tr-pipe fix delivered \n-terminated progress lines but tr's stdout is block-buffered (4 KB chunks) when its destination is a pipe — and the SSH channel is a pipe. At ~50 bytes per badblocks progress line, that means ~80 lines accumulate (~6 minutes at our throughput) before tr flushes anything. stdbuf -oL forces tr's stdout to line-buffered mode. Each \n now triggers a flush. Progress lines reach asyncssh as they happen.
This commit is contained in:
parent
7c3873dd5e
commit
129f233e0a
2 changed files with 6 additions and 6 deletions
|
|
@ -124,11 +124,11 @@ def _build_badblocks_cmd(devname: str) -> str:
|
|||
f"-p {settings.surface_validate_passes} "
|
||||
f"/dev/{devname} 2>&1"
|
||||
)
|
||||
# The outer pipeline lets tr translate \\b → \\n. Single quotes
|
||||
# around the inner script prevent the host shell from interpreting
|
||||
# $$. The tr argument uses $'\\b' / $'\\n' escapes — POSIX shells
|
||||
# interpret these as the literal backspace and newline bytes.
|
||||
return f"sh -c '{inner}' | tr '\\b' '\\n'"
|
||||
# The outer pipeline lets tr translate \\b → \\n. stdbuf -oL forces
|
||||
# tr's stdout to line-buffered mode; without it tr's stdout is
|
||||
# block-buffered (4 KB chunks) when its destination is a pipe,
|
||||
# which delays each progress line by ~6 minutes at our throughput.
|
||||
return f"sh -c '{inner}' | stdbuf -oL tr '\\b' '\\n'"
|
||||
|
||||
from . import kill
|
||||
from ._common import (
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class Settings(BaseSettings):
|
|||
ssh_key: str = "" # PEM private key content (paste full key including headers)
|
||||
|
||||
# Application version — used by the /api/v1/updates/check endpoint
|
||||
app_version: str = "1.0.0-57"
|
||||
app_version: str = "1.0.0-58"
|
||||
|
||||
# ---- Authentication (1.0.0-22) ----
|
||||
# session_secret: HMAC key for signing session cookies. Empty = generate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue