-
Notifications
You must be signed in to change notification settings - Fork 733
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
Workaround for If-Modified-Since
HTTP request header causing cache corruption
#665
Conversation
e29b1b2
to
0d9ec1c
Compare
0d9ec1c
to
72aedbb
Compare
// | ||
// NOTE: This is even worse than you might think: 404 responses don't return an ETAG, but 304 responses do. | ||
// | ||
// Due erroneous 304 returned from "If-Modified-Since", the ETAG returned by the first 304 |
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.
@bitwiseman I would suggest looking into the logic of the github branch source plugin as well. The problem here as per https://issues.jenkins-ci.org/browse/JENKINS-60353 is that Jenkins checks the existence of the Jenkinsfile for the 'MERGE' head of a non-mergeable request, the one that does not exist a priori and then consequently marks the pr as dead/non-buildable. |
@aglarendil |
This is a first cut at working round hub4j#669. It is hacky as hell and I hate it.
This reverts commit 90d7fea.
This is much more reasonable way to address this issue. When the Requester detects a 404 response with an ETag (only happpens when the server's 304 is bogus and would cause cache corruption), try the query again with new request header that forces the server to not return 304 and return new data instead. Ths solution is transparent to users of this library and autmatically fixes a situation that was causing cache corruption. If GitHub ever fixes the issue and begins providing accurate ETags to their 404 responses, this will result in two calls being made for each 404 response. While that would be unfortunate, it would still be better than the current situation.
OkHttp2 doesn't invalidate caches sometimes when it probably should
983c72b
to
3479e4f
Compare
If-Modified-Since
HTTP request header causing cache corruption
55e1d3b
to
66a1803
Compare
Overview
This PR shows a low level repro of an issue that has been plaguing Jenkins users for at least the last year.
EDIT: Similar to isaacs/github#692 but not the same
Key Takeaways
Basic Repro Steps
This basic process can be used for many queries that return 404. Using Ref creation as an example: