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

mqb: fix ClientSession::initiateShutdown crash #349

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

dorjesinpo
Copy link
Collaborator

    // The 'd_self.acquire()' return 'shared_ptr<ClientSession>' but that does
    // not relate to the 'shared_ptr<mqbnet::Session>' acquired by
    // 'mqbnet::TransportManagerIterator'.  The latter is bound to the
    // 'initiateShutdown'.  The former can be null after 'd_self.invalidate()'
    // call. ('invalidate()' waits for all _acquired_ 'shared_ptr' references
    // to drop).
    //
    // We have a choice, either 1) bind the latter to 'initiateShutdown' to
    // make sure 'd_self.acquire()' returns not null, or 2) invoke the
    // 'callback' earlier if fail to 'acquire()' because of 'invalidate()', or
    // 3) bind _acquired_ 'shared_ptr' to 'initiateShutdown'.
    //
    // Choosing 2), assuming that calling the (completion) callback from a
    // thread other than the *CLIENT* dispatcher thread is ok.  The
    // 'mwcu::OperationChainLink' expects the completion callback from multiple
    // sessions anyway.

@dorjesinpo dorjesinpo added the bug Something isn't working label Jul 2, 2024
@dorjesinpo dorjesinpo requested a review from a team as a code owner July 2, 2024 14:11
@dorjesinpo dorjesinpo force-pushed the fix/cs-initiateShutdown branch 2 times, most recently from 659390c to af7e2f9 Compare July 2, 2024 14:14
@dorjesinpo dorjesinpo force-pushed the fix/cs-initiateShutdown branch from af7e2f9 to 5e96b71 Compare July 2, 2024 14:15
@678098 678098 self-assigned this Jul 2, 2024
@678098 678098 self-requested a review July 2, 2024 15:18
@dorjesinpo dorjesinpo merged commit 82c3a71 into main Jul 2, 2024
26 checks passed
alexander-e1off pushed a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
alexander-e1off pushed a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
alexander-e1off pushed a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants