Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
proton-c-0.22.0
-
None
-
None
Description
There is a disabled test to reproduce this problem, see test_duplicate_link_client() in
https://github.com/alanconway/qpid-proton/blob/master/c/tests/connection_driver.c#L498
pni_process does all pending link opens before all pending link closes, it does not respect the order of individual open/close calls in the code. This doesn't cause a problem for distinct links but if a link of the same name is opened/closed/reopened very quickly it can cause a problem:
For example if l1 and l2 are both pn_links with name "x" then this sequence:
open(l1); close(l1); open(l2)
generates this illegal protocol sequence:
attach("x"); attach("x"); detach(0) // 0 is the handle assigned to "x"
instead of the intended legal sequence:
attach("x"); detach(0); attach("x") // detach(0) detaches the first "x" so second "x" is allowed
NOTE: This applies to all endpoints, not just links but since connections and sessions don't have client-assignable names that can clash, the problem only shows up for links and only if the detach/attach for the same name is processed in the same transport batch. This is unlikely in practice and was discovered only because of investigation of PROTON-1832.
Attachments
Issue Links
- is a clone of
-
PROTON-1832 [c] duplicate link names cause invalid read in pn_transport_unbind_handles
- Closed