Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider errors from htcondor scheduler #10

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Conversation

fraimondo
Copy link
Contributor

Under certain cirscunstances, this error might appear:

2024-10-28 01:02:39,583 - joblib_htcondor.backend - ERROR - Traceback (most recent call last):
  File "/home/fraimondo/dev/tbox/joblib-htcondor/joblib_htcondor/backend.py", line 907, in _watcher
    self._client.submit(
  File "/home/fraimondo/miniconda3/envs/julearn/lib/python3.12/site-packages/htcondor2/_schedd.py", line 454, in submit
    return _schedd_submit(self._addr, real._handle, count, spool)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: Failed to connect to schedd.

Currently, if this happens, then the job is not submitted but also removed from the backend queue, resulting in joblib never finishing as at least one future will not have a result.

This PR fixes this issue by:

  1. Surrounding the _client.submit call in a try/except block.
  2. Re-adding the job back to the backend queue if this call fails.
  3. Deleting the pickled job file/
  4. Showing an error in the log.
  5. Waiting 1 second before continuing, to avoid spamming the scheduler that might be overwhelmed.

@fraimondo fraimondo merged commit 134f644 into main Oct 28, 2024
2 checks passed
@fraimondo fraimondo deleted the fix/schedd_connect_failed branch October 28, 2024 09:24
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.

2 participants