Closed jean-roland closed 1 week ago
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 ?
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.
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.
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.