fix(file-tools): count bad_size probe as an existing remote binary
_probe_regular_file returns "bad_size" only after `[ -f ]` succeeded and `wc -c` output was unparseable, so a regular file IS present on the execution target. Treat it as "exists" (the precise existing-binary refusal) instead of the generic "unavailable" retry message; both refuse, but the retry hint is wrong for a file that is known to exist. Mirrors how the other _probe_regular_file callers treat bad_size. Idea and the original report/Docker reproduction come from #122663, the first submitted fix for this bug. Fixes #122662 Co-authored-by: liuzikaii <2319582736@qq.com>
This commit is contained in:
@@ -468,7 +468,8 @@ def _target_regular_file_state(filepath: str, task_id: str = "default") -> str:
|
||||
_size, status = file_ops._probe_regular_file(file_ops._expand_path(resolved or filepath))
|
||||
except Exception:
|
||||
return "unavailable"
|
||||
if status == "ok":
|
||||
if status in ("ok", "bad_size"):
|
||||
# bad_size: ``[ -f ]`` succeeded, only ``wc`` was unparseable.
|
||||
return "exists"
|
||||
if status in ("missing", "not_regular"):
|
||||
# not_regular: no REGULAR file at the path (dir/FIFO/dangling link) —
|
||||
|
||||
Reference in New Issue
Block a user