Repository navigation
Adds socket timeout and validate file size - #269
Merged
Merged
Conversation
joshmgross
approved these changes
Apr 23, 2020
joshmgross
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
I left some clarifying questions
|
Nice work! Hope that this will be merged. |
aiqiaoy
reviewed
Apr 28, 2020
|
|
||
| export const CacheFilename = "cache.tgz"; | ||
|
|
||
| export const SocketTimeout = 5000; |
Contributor
Author
There was a problem hiding this comment.
Added comment with details.
aiqiaoy
reviewed
Apr 28, 2020
aiqiaoy
approved these changes
Apr 28, 2020
|
Ty! |
|
Validation is work #271. So to finally fix this problem we need to wrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds socket timeout of 5 seconds and validates file size.
Recent network issues between the Actions runner and cache storage have caused flakiness in download speeds. While debugging, we observed periods where no traffic was received over the socket. In some cases, no traffic is received but the socket remains open for many minutes. Furthermore, if the socket closes before all content is received, the cache action incorrectly proceeds to untar the file, causing an "unexpected end of file" error.
This PR sets a socket timeout of 5 seconds. As a result, if there is a period were no traffic is received for 5 seconds, the download will abort and will be treated as a cache miss. Additionally, the downloaded file size is compared against the expected content length, if provided.