Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Dropping a
Session::BatchGuardcurrently callsz_session_drop, which explicitly closes the shared session even though the guard only cloned its reference. A second batch can therefore start successfully but its publisher subsequently fails withZ_ERR_SESSION_CLOSED.Release the guard's reference with
_z_session_rc_dropafter stopping the batch. Also implement ownership-transferring move operations: the default moves copy the C handle without invalidating the source, and move assignment overwrites the destination's previous reference without stopping its batch.Add a router-free regression test using isolated loopback TCP session pairs. It covers repeated batches with explicit flush and destructor flush, publishing and declaring a publisher after a batch, move construction, move assignment over an active guard, self-move assignment, and a failed nested start leaving the original batch active.
Related: eclipse-zenoh/zenoh-pico#1315. This addresses the C++ guard lifetime and repeated-batch failure; the separately reported declaration failure during an active batch is not covered by this change.
Validation on Ubuntu 22.04, GCC 11, zenoh-pico
d9b4eea486ea90bbeb61dd59cace7bac54a18562:2fafc38700d256335c1b4f76b3212c42cc70b8c1:assert(!session.is_closed())after the first batch.protocol/iobuf.h:91code (null pointer passed as argument 2); UBSan is not claimed clean.The contributor ECA check has passed.