Skip to content

fix: remove Dask client.shutdown() in build_renewable_profiles#2131

Open
thogin wants to merge 1 commit intoPyPSA:masterfrom
thogin:fix/remove-dask-shutdown-renewable-profiles
Open

fix: remove Dask client.shutdown() in build_renewable_profiles#2131
thogin wants to merge 1 commit intoPyPSA:masterfrom
thogin:fix/remove-dask-shutdown-renewable-profiles

Conversation

@thogin
Copy link
Copy Markdown
Contributor

@thogin thogin commented Mar 28, 2026

Changes proposed in this Pull Request

Removes the explicit client.shutdown() call at the end of build_renewable_profiles.py. This call can fail with a TimeoutError when Dask worker processes don't exit within the nanny timeout on shared filesystems (e.g. BeeGFS), converting a completed run into a false Snakemake failure.

Both output files (.nc profile and .geojson class regions) are written before the shutdown call. The other Dask-using scripts in the repo (build_hac_features, build_line_rating, build_daily_heat_demand) do not call client.shutdown() and rely on process exit for cleanup — this change aligns build_renewable_profiles with that pattern.

Observed on a SLURM/BeeGFS cluster: 3 false failures out of ~130 runs (2.3%) over 4 weeks, all during the Dask teardown phase after successful computation and output file writing.

Checklist

  • Changes are tested locally and behave as expected.
  • Code and workflow changes are documented.
  • A release note entry is added to doc/release_notes.rst.

The explicit client.shutdown() call can fail with a TimeoutError when
Dask worker processes don't exit within the nanny timeout on shared
filesystems (e.g. BeeGFS), converting a completed run into a false
Snakemake failure. Both output files are written before the shutdown
call, so the failure only affects cleanup.

The other Dask-using scripts in the repo (build_hac_features,
build_line_rating, build_daily_heat_demand) rely on process exit for
cleanup and do not call client.shutdown().
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.

1 participant