Fix[mqb]: drain on closeChannel#1221
Conversation
e4ac66d to
34422aa
Compare
|
|
||
| d_state.testAndSwap(e_READY, e_CLOSE); | ||
| } | ||
| wakeUp(); |
There was a problem hiding this comment.
How are we guaranteed that we'll be in the IDLE mode for the channel close logic to kick in here?
There was a problem hiding this comment.
The mode can be any after d_isClosing.store(true);
If it is e_BLOCK, the wakeUp(); should wake it up and the mode goes the cycle
e_BLOCK -> e_FLUSH_BUFFER -> e_IDLE -> e_BLOCK
This logic is based on the fact that after wakeUp();, the mode must arrive at e_IDLE where d_isClosing gets picked up (unless resetChannel()/setChannel() happens which means the channel is closed).
There was a problem hiding this comment.
We can remove explicit values or start them from 0
| // PUBLIC TYPES | ||
| enum EnumState { | ||
| /// Not connected | ||
| e_INITIAL = 0, |
There was a problem hiding this comment.
This enum value is still mentioned in the component's docs.
These docs are also outdated:
blazingmq/src/groups/mqb/mqbnet/mqbnet_channel.h
Lines 48 to 67 in 34422aa
34422aa to
631778a
Compare
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
631778a to
4af2c2d
Compare
|
(unrelated) IT failure is analyzed and the fix is created #1257 |
mqbnet::Channel::closeChannelshould close channel (asynchronously) only after sending all items unless channel is closed