You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "songgaoye (via GitHub)" <gi...@apache.org> on 2026/10/19 14:39:47 UTC

[PR] fix(common): prevent ScopeExit cleanup after move [kvrocks]

songgaoye opened a new pull request, #3696:
URL: https://github.com/apache/kvrocks/pull/3696

   Summary
   
   Prevent `ScopeExit` from running its cleanup callback twice after move construction.
   
   - Disable the moved-from guard after its callback has been successfully moved.
   - Preserve the moved-to guard's enabled state.
   - Keep the source guard enabled if moving the callback throws.
   
   Without this change, both the moved-to and moved-from guards could invoke a non-idempotent cleanup callback during destruction.
   
   ## Tests
   
   - Added focused unit coverage for move construction and single cleanup execution.
   - `./x.py format`
   - LLVM 18 `clang-tidy` on `scope_exit_test.cc`.
   - Ran `ScopeExit.MoveConstructionRunsCleanupOnce` successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): prevent ScopeExit cleanup after move [kvrocks]

Posted by "songgaoye (via GitHub)" <gi...@apache.org>.
songgaoye commented on PR #3696:
URL: https://github.com/apache/kvrocks/pull/3696#issuecomment-6315521977

   This is a pre-existing flaky kvrocks2redis CI failure, tracked in #2574. It appears unrelated to this change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): prevent ScopeExit cleanup after move [kvrocks]

Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on PR #3696:
URL: https://github.com/apache/kvrocks/pull/3696#issuecomment-6291301685

   @songgaoye Could you please add an AI-use disclosure to the PR description, following the [contribution guidelines](https://github.com/apache/kvrocks-website/blob/main/community/contributing.md#guidelines-for-ai-assisted-contributions)? Please state whether AI was used and, if so, which tools were used, what they helped with, and any parts needing extra review. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): prevent ScopeExit cleanup after move [kvrocks]

Posted by "songgaoye (via GitHub)" <gi...@apache.org>.
songgaoye commented on PR #3696:
URL: https://github.com/apache/kvrocks/pull/3696#issuecomment-6294441996

   @jihuayu updated


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(common): prevent ScopeExit cleanup after move [kvrocks]

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk merged PR #3696:
URL: https://github.com/apache/kvrocks/pull/3696


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org