-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(mac): add retry in mac code sign #8101
Conversation
🦋 Changeset detectedLatest commit: 09becc6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for car-park-attendant-cleat-11576 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
if (keychain != null) { | ||
args.push("--keychain", keychain) | ||
export async function sign(opts: SignOptions): Promise<void> { | ||
const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to add a timeout? I'm worried it won't account for slow network connections and I haven't seen any issues reported of the codesign process hanging.
Kind of in favor of just using builder-util
's retry
mechanism
electron-builder/packages/builder-util/src/util.ts
Lines 407 to 419 in a13a539
export async function retry<T>(task: () => Promise<T>, retriesLeft: number, interval: number, backoff = 0, attempt = 0): Promise<T> { | |
try { | |
return await task() | |
} catch (error: any) { | |
log.info(`Above command failed, retrying ${retriesLeft} more times`) | |
if (retriesLeft > 0) { | |
await new Promise(resolve => setTimeout(resolve, interval + backoff * attempt)) | |
return await retry(task, retriesLeft - 1, interval, backoff, attempt + 1) | |
} else { | |
throw error | |
} | |
} | |
} |
Would simplify this logic to:
retry(() => signAsync(opts), 3, 5000, 5000)
3 retries, 5sec interval, with 5sec multiplier backoff delay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree with you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmaietta We've been experiencing difficulties with the codesigning process lately. We have encountered instances where the codesign process hangs, causing delays in our development workflow. This has been a recurring problem for us and has impacted our productivity. We would appreciate any assistance or guidance you can provide to resolve these codesigning issues effectively.
fix #8089