-
Notifications
You must be signed in to change notification settings - Fork 527
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 ScrollID used for retrieval of APM Agents configuration #13958
Conversation
💚 CLA has been signed |
08ecb6f
to
eaafc91
Compare
This pull request does not have a backport label. Could you fix it @up2neck? 🙏
NOTE: |
eaafc91
to
d9adabc
Compare
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.
Thanks for the PR. Nice catch!
Ideally this PR also updates the test to assert scroll id payload in elasticsearch_test.go
, but it may not be trivial. I'm happy to accept this PR as is, and I can add a test in a follow up PR.
@carsonip |
It doesn't hurt, but personally I do not think there is a need in handler to validate anything returned by Elasticsearch. We rely on Elasticsearch for a correct scroll ID, as well as correct search results. What's needed here is a better test, which I'm working on. Either way the error will be surfaced, just more explicitly if an additional check is in place, or a little more obscurely in a form of HTTP 400 like this case. |
But original code contains HTTP validation, but only for the first search request: apm-server/internal/agentcfg/elasticsearch.go Lines 255 to 278 in a5aaf07
Probably we can modify it to handle errors in both requests:
|
c33e7d0
to
710bdfa
Compare
Correct. There is no handling for bad HTTP response codes in scroll requests. In retrospect, there should be. Thanks for adding it to the PR. However, that increases the scope of this PR a little bit, and it will need to be tested on our end to avoid introducing regression (I don't expect any). |
9ac14c6
to
2031c34
Compare
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.
lgtm, thanks for the PR. I can confirm this fixes the scrolling bug by my follow-up PR to add tests: #13959 . The refactoring to handle http errors should be fine, as expired scroll requests returns 404.
run docs-build |
@up2neck do you mind signing the commits and force push? See https://docs.github.com/authentication/managing-commit-signature-verification/about-commit-signature-verification |
f5d8a4b
to
29ca344
Compare
Made it |
9e5c91d
to
de5453c
Compare
run docs-build |
de5453c
to
09d91be
Compare
@carsonip unfortunately, Github lost my commit signature after rebase in web UI. Have restored it. |
run docs-build |
run docs-build |
APM Agents configuration cache appears to be broken, resulting frequent invalid requests made by APM Server to Elasticsearch cluster. Fix ScrollID used for retrieval of APM Agents configuration. (cherry picked from commit ecffa8e)
Follow up on #13958 to add test
APM Agents configuration cache appears to be broken, resulting frequent invalid requests made by APM Server to Elasticsearch cluster. Fix ScrollID used for retrieval of APM Agents configuration. (cherry picked from commit ecffa8e) Co-authored-by: up2neck <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Follow up on #13958 to add test (cherry picked from commit 2aec4d1) Co-authored-by: Carson Ip <[email protected]>
Motivation/summary
APM Agents configuration cache appears to be broken, resulting frequent invalid requests made by APM Server to Elasticsearch cluster.
Checklist
For functional changes, consider:
How to test these changes
Related issues
closes #13957