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

Replying to a query with a closed session should not yield an UB. #476

Closed
jean-roland opened this issue Jun 28, 2024 · 3 comments
Closed

Comments

@jean-roland
Copy link
Contributor

Describe the feature

As we removed refcounting on queries, we no longer have the issue of cross-referencing rc that prevented us from refcounting the query session pointer.

A session rc is preferable to a pointer, especially if the query is used out of the callback context and more in line with the rest of the codebase.

@DenisBiryukov91
Copy link
Contributor

Is this really a good idea ? Do we really need to hold on session while query is still alive ? I.e. are we supposed to ignore z_close() and wait till all queries are resolved ?

@jean-roland
Copy link
Contributor Author

jean-roland commented Jun 28, 2024

I mean the session may outlive the z_close only if the user wants to use the query out of the callback context to make a reply.

The reverse is just a UB/segfault if the query is used to send a reply after z_close.

It feels like the former is better than the latter but it's open to discussion.

@jean-roland
Copy link
Contributor Author

After internal discussion, we'll keep the session as a reference, but we should make sure that replying to a closed session do not result in a UB.

@jean-roland jean-roland changed the title Replace query session pointer to refcounted session. Replying to a query witch a closed session should not yield an UB. Jul 1, 2024
@jean-roland jean-roland changed the title Replying to a query witch a closed session should not yield an UB. Replying to a query with a closed session should not yield an UB. Jul 2, 2024
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

No branches or pull requests

2 participants