Page MenuHomeElementl

Fix race condition when reload workspace is called from a background thread
ClosedPublic

Authored by dgibson on May 13 2021, 6:43 PM.

Details

Summary

Previous logic left a hole where there were no locations but the full set of origins. Instead, wrap the whole reload_workspace call in a lock.

Test Plan

BK (run an integration suite 10 times, before was periodically erroring out with the added invariant)

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sashank published this revision for review.May 13 2021, 6:48 PM
sashank added inline comments.
python_modules/dagster/dagster/cli/workspace/workspace.py
266

Just to be safe, should we add a

assert self._lock.locked()
This revision is now accepted and ready to land.May 13 2021, 6:49 PM
python_modules/dagster/dagster/cli/workspace/workspace.py
266

**To be safe against future refactors

This revision was landed with ongoing or failed builds.May 13 2021, 7:23 PM
This revision was automatically updated to reflect the committed changes.