Introduce JOB_DISCONNECTED_RETRY_TIMEOUT #2627
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2626
The PR changes process_running_jobs handling of ssh connection errors for pulling/running jobs. Previously, it failed jobs with no capacity after establishing ssh connection fails. Now, it keeps job active for at least JOB_DISCONNECTED_RETRY_TIMEOUT (2 minutes). This allows surviving temporary networking issues.
A possible regression is that dstack becomes slower to replace failed jobs/replicas. IMO, not a big problem since there are no expectations/guarantees on how quick the replacement is.
Later we can make timeout smarter depending on the job (e.g. short for spots, if retry enabled, etc). For now, keeping it as constant for simplicity.
Also introduced JobTerminationReason.INSTANCE_UNREACHABLE – not yet used because of backward compatibility.