Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
This fixes an issue were a database session got stuck #31128
This fixes an issue were a database session got stuck #31128
Changes from all commits
9d918d6
11b7568
9e2701c
a162752
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The call to
create_session
is no longer needed since you decoratedxcom_pull
with@provide_session
. The session will be automatically providedThere 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.
Am i missing something @uranusjr ?
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.
I think both work (and using the default session from
@provide_session
is cleaner so you’re correct)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.
Removing the create_session will actually remove the bug fix. As explained in the comment above the create session: the issue is that xcom_pull returns a LazyXComAccess iterator. Since we have returned from the xcom_pull function, the session that would have been automatically created there will be closed and thus a new one that leaks will be started when we iterate. By wrapping this in a manually created session the leak is fixed
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.
Ah I see, the point is to make the session live slightly longer so line 147 below can still use it.
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.
Maybe a comment above this block would help future readers understand the context better.
(Also I think the blank line + comments in lines 144-146 might actually hurt readability a bit since they make the two lines feel less associated. Maybe moving them above the entire block to make the
create_session
,xcom_pull
, andinlets.extend
lines stick close together would help as well.)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.
I remove the empty lines and 2 comments. I don't think the added much here.
There already is a comment above the create_session block to explain things, so I am not sure I correctly understand what you mean with
Maybe a comment above this block would help future readers understand the context better.
. Can you clarify it for me?