Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

fix: Fixed timeouts in case of slow XPI uploads to the signing server#213

Merged
kumar303 merged 2 commits into
mozilla:masterfrom
kumar303:jwt-timeout
Oct 6, 2016
Merged

fix: Fixed timeouts in case of slow XPI uploads to the signing server#213
kumar303 merged 2 commits into
mozilla:masterfrom
kumar303:jwt-timeout

Conversation

@kumar303
Copy link
Copy Markdown
Contributor

@kumar303 kumar303 commented Oct 6, 2016

The maximum allowed expiration time for JWT authentication has been increased in mozilla/addons-server#3686 to address a problem where slow file uploads delay the validation of the JWT (and could cause an expiration). This bumps the default expiration in the client and also lets the caller configure the value (if needed).

Copy link
Copy Markdown
Member

@rpl rpl left a comment

Choose a reason for hiding this comment

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

This patch looks good, but I've a doubt about the signedStatusCheckTimeout value, which is described in more detail in the comment below.

Comment thread src/amo-client.js
apiJwtExpiresIn=60 * 5, // 5 minutes
debugLogging=false,
signedStatusCheckInterval=1000,
signedStatusCheckTimeout=120000, // 2 minutes.
Copy link
Copy Markdown
Member

@rpl rpl Oct 6, 2016

Choose a reason for hiding this comment

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

@kumar303 the signedStatusCheckTimeout is now lower then the apiJwtExpiresIn time, shouldn't we raise it a bit? (to be a bit longer than the new JWT expiration time), am I right or am I missing something?

or maybe it is better to compute the signedStatusCheckTimeout value from the apiJwtExpiresIn value if not explicitly set in the parameters, how it sounds to you?

(and we should also add some new tests about the combined usage of the two values)

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.

This setting is actually unrelated and I think it makes sense to keep it at 2 minutes. Here is a rough sketch of what happens:

  • sign-addon uploads the file by making a POST or PUT to the API. This might take a while due to the size of the add-on and network connectivity.
  • The code begins its signedStatusCheckTimeout timer.
  • The code makes a GET request to the API in a loop and this must finish within 2 minutes.

However, you just made me realize the HTTP request could timeout. Fixed, thanks!

@rpl
Copy link
Copy Markdown
Member

rpl commented Oct 6, 2016

However, you just made me realize the HTTP request could timeout. Fixed, thanks!

@kumar303 that's great!

r+

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants