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

Update retry-staleness dynamics and error handling for locks #9

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
});
}

export const LOCKFILE_STALENESS = {stale: 5000}; // lock expiration in milliseconds to prevent deadlocks
export const LOCKFILE_STALENESS = {stale: 11000}; // lock expiration in milliseconds to prevent deadlocks
export const LOCKFILE_RETRY_CONFIG = {
retries: {
retries: 10,
retries: 12, // 9.5 seconds max
factor: 2,
minTimeout: 100,
maxTimeout: 1000,
Expand All @@ -108,9 +108,14 @@
return result;
} catch (error) {
debug(`Lockfile error: ${error}`);
// throw error;
throw error;

Check warning on line 111 in src/misc.ts

View check run for this annotation

Codecov / codecov/patch

src/misc.ts#L111

Added line #L111 was not covered by tests
} finally {
for (const release of releases)
if (release) release();
for (const release of releases) {
try {

Check warning on line 114 in src/misc.ts

View check run for this annotation

Codecov / codecov/patch

src/misc.ts#L113-L114

Added lines #L113 - L114 were not covered by tests
if (release) release();
} catch (error) {
debug(`Lockfile release error: ${error}`);

Check warning on line 117 in src/misc.ts

View check run for this annotation

Codecov / codecov/patch

src/misc.ts#L117

Added line #L117 was not covered by tests
}
}
}
}
Loading