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

Adjusting cancel and ensure close #2046

Merged
merged 7 commits into from
Dec 22, 2024
Merged

Adjusting cancel and ensure close #2046

merged 7 commits into from
Dec 22, 2024

Conversation

Paultagoras
Copy link
Contributor

Summary

  • Adjusts the cancel() method to use try-with-resources
  • Tries to ensure all of the .close() methods will be called (before bubbling up exceptions)

Checklist

Delete items not relevant to your PR:

  • Closes issue
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@Paultagoras Paultagoras self-assigned this Dec 20, 2024
@chernser
Copy link
Contributor

@Paultagoras We need tests for this:

  • cancel called from another thread while request
  • cancel called from any thread after request is complete

The whole change looks ok but this is an open door to concurrency issues because we share queryID between thread and cancel can be called at any time.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
37.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Paultagoras Paultagoras merged commit 5b3917f into main Dec 22, 2024
23 of 28 checks passed
@Paultagoras Paultagoras deleted the fix-connection-leak branch December 22, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants