Skip to content

fix CI log capture and races - #462

Merged
mattjala merged 2 commits into
HDFGroup:masterfrom
mattjala:fix/ci-flake-log-capture-and-gc-race
Sep 10, 2026
Merged

mattjala merged 2 commits into
HDFGroup:masterfrom
mattjala:fix/ci-flake-log-capture-and-gc-race

Conversation

@mattjala

@mattjala mattjala commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

hsds_app.py - the sub-process reader thread used a bytes sentinel on a
text-mode pipe, so it never stopped at EOF. The drain loop then never
broke and never closed the buffered logfile, so hs.log lost everything
written after the first node exit. This PR fixes the sentinel, has the
log close from a finally block, and drops the p.communicate() that can
race the reader thread for p.stdout.

fileClient.py - put_object stat'd the file it had just written to, so a
concurrent delete could turn a successful write into a 500 spuriously.
This demotes that stat to a warning and falls back to synthesizing the
response, the same approach s3Client already takes. It also stops the
bare except Exception from relabelling HTTP statuses as internal
errors, including the path-outside-root 400 raised via _mkdir.

datanode_lib.py, async_lib.py - a deleted root stayed queued in
root_scan_ids, so bucketScan could write .info.json and .summary.json
back into a prefix which bucketGC had just swept. This purges the root
on delete, and has scanRoot bail out if it has been deleted since the
scan was queued.

hsds_app.py - the sub-process reader thread used a bytes sentinel on a
text-mode pipe, so it never stopped at EOF. The drain loop then never
broke and never closed the buffered logfile, so hs.log lost everything
written after the first node exit. This PR fixes the sentinel, has the
log close from a finally block, and drops the p.communicate() that can
race the reader thread for p.stdout.

fileClient.py - put_object stat'd the file it had just written to, so a
concurrent delete could turn a successful write into a 500 spuriously.
This demotes that stat to a warning and falls back to synthesizing the
response, the same approach s3Client already takes. It also stops the
bare `except Exception` from relabelling HTTP statuses as internal
errors, including the path-outside-root 400 raised via _mkdir.

datanode_lib.py, async_lib.py - a deleted root stayed queued in
root_scan_ids, so bucketScan could write .info.json and .summary.json
back into a prefix which bucketGC had just swept. This purges the root
on delete, and has scanRoot bail out if it has been deleted since the
scan was queued.
Comment thread hsds/util/fileClient.py Fixed
Comment thread hsds/util/fileClient.py Dismissed
The digest is an HTTP ETag, and md5 is the S3 convention - a single-part
S3 upload's ETag is the md5 of the object bytes, and s3Client returns
that value straight from AWS - so fileClient computes the same thing to
keep the backends consistent. Those ETags also feed the per-object
checksums that scanRoot folds into a domain's md5_sum, so the algorithm
cannot change without the POSIX backend diverging from S3 for identical
data.

usedforsecurity=False records that intent in the code. It leaves the
digest unchanged, and keeps this working under FIPS, where an
unqualified hashlib.md5() raises.

The domain checksum in async_lib.py and the key prefix in nodeUtil.py
are the same kind of use, and are left alone here.
@mattjala
mattjala force-pushed the fix/ci-flake-log-capture-and-gc-race branch from 59ea41a to acf0efe Compare September 9, 2026 21:04
@mattjala
mattjala merged commit c11f530 into HDFGroup:master Sep 10, 2026
27 checks passed
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