Skip to content

Commit

Permalink
Lock warning (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgr authored Jan 18, 2023
1 parent 521de99 commit 8d29321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- You can now add arguments to steps without invalidating the cache. See `Step.SKIP_DEFAULT_ARGUMENTS`.
- Fixed integration status messages in `tango info` command.

### Fixed

- Warnings about locks are now reliably printed every 30 seconds


## [v1.1.0](https://github.com/allenai/tango/releases/tag/v1.1.0) - 2022-12-01

Expand Down
5 changes: 3 additions & 2 deletions tango/integrations/beaker/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,16 @@ def acquire(self, timeout=None, poll_interval: float = 2.0, log_interval: float
self._beaker.dataset.delete(self._lock_dataset_name)
continue

if last_logged is None or last_logged - start >= log_interval:
now = time.monotonic()
if last_logged is None or now - last_logged >= log_interval:
logger.warning(
"Waiting to acquire lock dataset for step '%s':\n\n%s\n\n"
"This probably means the step is being run elsewhere, but if you're sure it isn't "
"you can just delete the lock dataset.",
self._step_id,
self.lock_dataset_url,
)
last_logged = time.monotonic()
last_logged = now
time.sleep(poll_interval)
continue
else:
Expand Down

0 comments on commit 8d29321

Please sign in to comment.