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

Do not cancel context on Connection.Close #40769

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

belimawr
Copy link
Contributor

Proposed commit message

This commit removes a call to conn.cancelReqs() that causes the Connection to be unusable after Close() is called, leading to the bug described by #40705.

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.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

This commit removes a call to conn.cancelReqs() that causes the
Connection to be unusable after Close() is called, leading to the bug
described by elastic#40705.
@belimawr belimawr added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-8.15 Automated backport to the 8.15 branch with mergify backport-8.x Automated backport to the 8.x branch with mergify labels Sep 11, 2024
@belimawr belimawr requested a review from cmacknz September 11, 2024 20:05
@belimawr belimawr self-assigned this Sep 11, 2024
@belimawr belimawr requested a review from a team as a code owner September 11, 2024 20:05
@belimawr belimawr requested a review from faec September 11, 2024 20:05
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@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 Sep 11, 2024
@cmacknz cmacknz requested a review from marc-gr September 11, 2024 20:13
@@ -326,7 +326,6 @@ func (conn *Connection) Ping() (ESPingData, error) {
// Close closes a connection.
func (conn *Connection) Close() error {
conn.HTTP.CloseIdleConnections()
conn.cancelReqs()
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the diff from #40572, which introduced the issue, it seems that cancelReqs is only called here, and you ended up removing it as the fix. Does that mean we should just remove the other references to it as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a quick fix to fix our released branches while we work on the actual fix, hence I only removed the line causing the issue and left the rest of the feature. Soon I'll make a PR with tests and a proper fix.

@belimawr belimawr enabled auto-merge (squash) September 11, 2024 22:22
@belimawr
Copy link
Contributor Author

I think the CI failure is unrelated, I'm rerunning the tests. I also enabled auto-merge.

@belimawr belimawr merged commit b0e4f85 into elastic:main Sep 11, 2024
124 checks passed
mergify bot pushed a commit that referenced this pull request Sep 11, 2024
This commit removes a call to conn.cancelReqs() that causes the
Connection to be unusable after Close() is called, leading to the bug
described by #40705.

(cherry picked from commit b0e4f85)
mergify bot pushed a commit that referenced this pull request Sep 11, 2024
This commit removes a call to conn.cancelReqs() that causes the
Connection to be unusable after Close() is called, leading to the bug
described by #40705.

(cherry picked from commit b0e4f85)
belimawr added a commit that referenced this pull request Sep 12, 2024
This commit removes a call to conn.cancelReqs() that causes the
Connection to be unusable after Close() is called, leading to the bug
described by #40705.

(cherry picked from commit b0e4f85)

Co-authored-by: Tiago Queiroz <[email protected]>
belimawr added a commit that referenced this pull request Sep 12, 2024
This commit removes a call to conn.cancelReqs() that causes the
Connection to be unusable after Close() is called, leading to the bug
described by #40705.

(cherry picked from commit b0e4f85)

Co-authored-by: Tiago Queiroz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.15 Automated backport to the 8.15 branch with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants