Skip to content
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

[Heartbeat] Separate http req per task #29697

Merged
merged 5 commits into from
Jan 6, 2022

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Jan 5, 2022

This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

What does this PR do?

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

This is an attempt to fix the race reported in elastic#29580 by instantiating a
separate http request per HTTP task. The theory being that the HTTP
library modifies the headers and that the req object is not safe to
share.

Needs further experimentation / validation / testing.
@andrewvc andrewvc added bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Jan 5, 2022
@andrewvc andrewvc self-assigned this Jan 5, 2022
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jan 5, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 5, 2022

This pull request does not have a backport label. Could you fix it @andrewvc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jan 5, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 5, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-06T20:51:29.195+0000

  • Duration: 73 min 42 sec

  • Commit: 76b04d8

Test stats 🧪

Test Results
Failed 0
Passed 3277
Skipped 71
Total 3348

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@andrewvc andrewvc added backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Jan 5, 2022
@andrewvc
Copy link
Contributor Author

andrewvc commented Jan 6, 2022

Gist of a stacktrace I captured when I repro'd it https://gist.github.com/andrewvc/977e17c7d9a2863c1432aa120e9c4ca0

@andrewvc
Copy link
Contributor Author

andrewvc commented Jan 6, 2022

Seems like #27509 is what broke this after analysis

@andrewvc andrewvc requested a review from justinkambic January 6, 2022 20:50
@andrewvc andrewvc marked this pull request as ready for review January 6, 2022 20:50
@andrewvc andrewvc requested a review from a team as a code owner January 6, 2022 20:50
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Tested this locally with repeatable results and it works well. Code seems fine.

LGTM.

@andrewvc andrewvc merged commit 27f2d00 into elastic:master Jan 6, 2022
mergify bot pushed a commit that referenced this pull request Jan 6, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)
mergify bot pushed a commit that referenced this pull request Jan 6, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)
@andrewvc
Copy link
Contributor Author

andrewvc commented Jan 6, 2022

@Mergifyio backport 7.16

@andrewvc andrewvc deleted the fix-conc-http-map-write branch January 6, 2022 23:09
mergify bot pushed a commit that referenced this pull request Jan 6, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)
@mergify
Copy link
Contributor

mergify bot commented Jan 6, 2022

backport 7.16

✅ Backports have been created

andrewvc added a commit that referenced this pull request Jan 7, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
andrewvc added a commit that referenced this pull request Jan 7, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
andrewvc added a commit that referenced this pull request Jan 7, 2022
This is an attempt to fix the race reported in #29580 by instantiating a separate http request per HTTP task. The theory being that the HTTP library modifies the headers and that the req object is not safe to share.

This has passed manual testing using mode: all against endpoints with multiple A records.

Tests are not included here due to the tricky nature of testing here, but we will do so in a follow-up

(cherry picked from commit 27f2d00)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants