-
Notifications
You must be signed in to change notification settings - Fork 113
Fix potential resource leak in CloudFetchQueue
#624
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: varun-edachali-dbx <[email protected]>
…gardless of server side state Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
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.
Good catch! Thanks for this 🚢
@@ -1509,6 +1509,7 @@ def close(self) -> None: | |||
if isinstance(e.args[1], CursorAlreadyClosedError): | |||
logger.info("Operation was canceled by a prior request") | |||
finally: | |||
self.results.close() |
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.
nit: Can you move the self.results.close()
, within the try block. - Logical step will be first close the resultSet and then close the command on the server. Secondly don't want any error in the finally part, this will lead to op_state variables in unset state
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 making the changes
What type of PR is this?
Description
The
ResultFileDownloadManager
in theCloudFetchQueue
is not shut down alongside theResultSet
.The
ResultFileDownloadManager
on being requested for a file ensures that the "download queue is always full", i.e. it adds uptomax_download_threads
Futures into_download_tasks
. In caseResultSet.close()
is invoked after this,_shutdown_manager
(defined forResultFileDownloadManager
) is NOT called, so these Futures keep executing in the background and the files keep being downloaded.We define a
close
for theCloudFetchQueue
that invokes_shutdown_manager
.How is this tested?
Related Tickets & Documents
N/A