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

Return early if http client is already closed #24353

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Dec 3, 2024

If the query is cancelled the existing code can result in:

presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr	java.lang.IllegalStateException: client is already marked as completed
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at com.google.common.base.Preconditions.checkState(Preconditions.java:513)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at io.trino.operator.DirectExchangeClient.addPages(DirectExchangeClient.java:333)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at io.trino.operator.DirectExchangeClient$ExchangeClientCallback.addPages(DirectExchangeClient.java:427)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at io.trino.operator.HttpPageBufferClient$1.onSuccess(HttpPageBufferClient.java:436)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at io.trino.operator.HttpPageBufferClient$1.onSuccess(HttpPageBufferClient.java:367)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1137)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
presto-worker       | 2024-12-03T20:36:32.663+0545	INFO	page-buffer-client-callback-65	stderr		at java.base/java.lang.Thread.run(Thread.java:1575)

as the in-flight request will try to call addPages while the client was already marked as completed

Description

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Dec 3, 2024
@wendigo wendigo requested a review from losipiuk December 3, 2024 15:11
@wendigo wendigo merged commit 4de3e5a into master Dec 3, 2024
104 checks passed
@wendigo wendigo deleted the serafin/return-early branch December 3, 2024 16:24
@github-actions github-actions bot added this to the 467 milestone Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants