gedih3.doctor.diagnoses.orphans#
orphans diagnosis — leftover temp files and empty partition directories.
- Detects:
*.tmp,*.join.tmp,*.fill.tmp,*.dedup.tmpunder db / tmp roots._s3_download/anddask-worker-space/directories left behind by crashed builds.Empty
h3_*/partition directories (no parquet files).Empty year subdirs.
A finding is only flagged when the file/dir’s mtime is older than
--orphan-age-hours (default 24h) so an in-progress build isn’t disturbed.
- Performance pillar (v0.8.x lessons backport):
The temp-file/leftover-dir scan over the database root is pushed to workers via
gedih3.doctor.parallel.parallel_map()— one task perh3_*partition. Mirrors the build merge phase’s_list_year_subdirspattern (gh3builder.py:906-924) which eliminated the same driver-side recursive walk on continental builds.Empty-partition / empty-year-dir checks are O(1)
os.scandirinstead ofglob.glob('**/*.parquet', recursive=True)(matches the build pipeline’s emptiness check at gh3builder.py:1356-1362).The temp directory’s scan stays driver-side because it’s narrow and not nested as deeply as the database tree.
Functions#
|
|
|
Module Contents#
- gedih3.doctor.diagnoses.orphans.orphans_check(ctx: gedih3.doctor.report.DoctorContext) gedih3.doctor.report.Report[source]#
- gedih3.doctor.diagnoses.orphans.orphans_fix(ctx: gedih3.doctor.report.DoctorContext, report: gedih3.doctor.report.Report) gedih3.doctor.report.Report[source]#