Fix weather client file handling and lookup bugs #19
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/weather-clients"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Audit weather-clients group.
Verified: targeted tests green; full suite passes on combined tree.
🤖 Skippy PR review
2 findings — none blocking.
lib/microwaveprop/propagation/pgrid.ex:136lib/microwaveprop/canopy.ex:134Findings outside the commentable diff
lib/microwaveprop/propagation/pgrid.ex:136— The fd leak fixed in Sgrid.read_point_from_path also exists in Pgrid.read_point/3 (outside this diff)read_header/1returns the bare atom:errorfor a short or foreign header, so theelse _ -> nilbranch returns without:file.close(fd)and leaks one raw fd per call. Identical defect to the one fixed inSgrid.read_point_from_path/3here. Reachable fromProfilesFile.read_point/3, which guards withPgrid.exists?/1(a plainFile.exists?), so one truncated or wrong-version.pgridleft by a killed writer leaks an fd on every point lookup (CurrentConditionscalls it per point) until the pod hits EMFILE and every:file.openin the process fails. Thetry/aftershape from the Sgrid fix closes it.lib/microwaveprop/canopy.ex:134— Canopy.prune_older_than still counts candidates and swallows delete failures (outside this diff)do_delete/1discards theFile.rm/File.rm_rfresult with no log line, andprune_file/4increments the count regardless, so a canopy store that never shrinks still reports a healthy prune. That is the exact failure modeFilePrunewas added for, andPropagationPruneWorker.process/1calls this three lines below theMsFootprintscall this PR fixed, loggingcanopy_deletedthe same way. Files viaFilePrune.delete_all/2, directories through the rm_rf-counted pathScalarFileuses here.Reviewed
5b92415b3b51. Commentskippy reviewto re-run.Addressed in
99945e7e:FilePrune.delete_all/2for files and an rm_rf-counted path for dirs, same contract as the ScalarFile fix. Failures now log and are excluded from the count.fix/propagation-pipeline), which owns that file; same try/after shape as the Sgrid fix here.skippy review
🤖 Skippy PR review — follow-up on
99945e7e6cdcNo new findings in the new commit.
Canopy.prune_older_than/1now sends files throughFilePrune.delete_all/2and directories through a countedrm_rfthat logs failures, so the value handed tomaybe_rmdir_empty/2is now real deletions. CheckedFile.rm_rf/1against the stdlib: the removed list includes the root path, sopath in removedcounts a directory correctly (it is not a permanent false, which would have re-created the undercount for dirs).Pgrid.read_point/3still leaks an fd whenread_header/1returns:error,lib/microwaveprop/propagation/pgrid.ex:136.Reviewed
99945e7e6cdc. Commentskippy reviewto re-run.99945e7e6cb34f48f65aReviewed
99945e7: the Canopy finding from the last review is fixed. Files now go throughFilePrune(only real deletions counted, failures logged with path and reason) and directories through anrm_rfpath with the same count-and-log contract, so a canopy store that cannot shrink is no longer reported as a healthy prune. Nothing new in the commit - the HRDPS/Sgrid/TempFile/HRRR-idx/NARR/SkewtParams changes reviewed earlier all still read correct at this head.Still open from the last review (suggestion, outside this diff, unchanged at this head):
Pgrid.read_point/3(lib/microwaveprop/propagation/pgrid.ex) leaks its raw fd whenread_header/1fails, the same defect fixed inSgrid.read_point_from_path/3here. Suggestions do not hold the check red.Rechecked
b34f48f6— no new findings.Both earlier findings are fixed:
Canopy.prune_older_than/1now counts real deletions throughFilePruneand logsrm_rffailures (lib/microwaveprop/canopy.ex:151); fixed in this commit.Pgrid.read_point/3no longer leaks the fd whenread_header/1fails — it uses the sametry/aftershape as the Sgrid fix here. That landed on main with #18 and the rebase picked it up, which is also why this ran as a full-diff review:99945e7eis no longer in the branch history.No blocking findings left.