Skip to content

Retry flaky connections - #361

Closed
SimonSchwendele wants to merge 5 commits into
ebourg:masterfrom
SimonSchwendele:master
Closed

SimonSchwendele wants to merge 5 commits into
ebourg:masterfrom
SimonSchwendele:master

Conversation

@SimonSchwendele

Copy link
Copy Markdown
Contributor

When using Azure Artifact Signing (azure trusted signing) you're currently ewxperiencing degarded performance.
The api responds slower with each file until it jsign eventually exits.

Eventually we reach AuthenticodeSignedDataGenerator.getSignerInfo where where azts dies with a 500 that stops the remaining signatures to be done.

Our action crashes like this (sorry for the screenshot, our logs expire pretty fast)
image

This extends the currently implemented retry loop to retry on errors as well not just on timeouts.
I assume that the remotes would rather send 4xx responses when issues arise with the files or this cli.

Comment thread jsign-crypto/src/main/java/net/jsign/jca/RESTClient.java Outdated
Comment thread jsign-crypto/src/main/java/net/jsign/jca/RESTClient.java
Comment thread jsign-crypto/src/main/java/net/jsign/jca/RESTClient.java Outdated
wait = getBackoffDelayMs(attempt);
}
log.fine(String.format("HTTP error %d from %s, retrying in %d ms (attempt %d of %d)", responseCode, url, wait, attempt, retries));
conn.disconnect();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disconnect() is not necessary here, if there is a keep-alive the connection can be reused for the next attempt. Java will disconnect automatically afterward.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry felt like it'd be more clean that way.
I'll alter that when I am done with work

@ebourg

ebourg commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Thank you for the PR. Do you think you could add some tests to RESTClientTest ?

@SimonSchwendele

Copy link
Copy Markdown
Contributor Author

Thank you for the PR. Do you think you could add some tests to RESTClientTest ?

Sure no problem I'll do that after work.

@ebourg ebourg added this to the 8.0 milestone Sep 7, 2026
@ebourg ebourg closed this in 9859165 Sep 7, 2026
@ebourg

ebourg commented Sep 7, 2026

Copy link
Copy Markdown
Owner

PR merged with a few cosmetic changes, thank you for the help!

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