Skip to content

CBL-8475: Use AtomicRetained in Replicator::Subreplicators - #2503

Merged
pasin merged 2 commits into
release/4.1from
fix/mailbox-race-CBL-8475
Jun 19, 2026
Merged

CBL-8475: Use AtomicRetained in Replicator::Subreplicators#2503
pasin merged 2 commits into
release/4.1from
fix/mailbox-race-CBL-8475

Conversation

@snej

@snej snej commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes a race condition when a Replicator is torn down.

Some code had to be altered, because AtomicRetained is a bit harder to use: you have to first call get() to get a temporary Retained object, then use that.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (i.e. changes needed for building an older version)
  • A change that has been granted an exception (please comment)

@snej
snej requested a review from borrrden June 17, 2026 00:22
@borrrden

Copy link
Copy Markdown
Member

The downstream stuff needs to go into fleece release/4.1 before it can go into lite-core release/4.1

@snej
snej force-pushed the fix/mailbox-race-CBL-8475 branch from 3f6592f to 5c7f544 Compare June 17, 2026 16:02
Fixes a race condition when a Replicator is torn down.
@snej
snej force-pushed the fix/mailbox-race-CBL-8475 branch from 5c7f544 to b185aef Compare June 17, 2026 19:34
@couchbase couchbase deleted a comment from github-actions Bot Jun 18, 2026
@couchbase couchbase deleted a comment from github-actions Bot Jun 18, 2026
@snej

snej commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Ubuntu build failed with a GCC error building Fleece tests.

couchbase-lite-core/vendor/fleece/Tests/SupportTests.cc:476:15: error: alias template 'AtomicRef' requires template arguments; argument deduction only allowed for class templates
  476 |     AtomicRef r = new AtomicRetainedTest();

Why wasn't this caught by Fleece's CI? ... hm, one difference is that Fleece's Ubuntu builds use GCC, while LiteCore's use Clang. But Clang on macOS didn't get this error. Different versions of Clang, perhaps?

@couchbase couchbase deleted a comment from github-actions Bot Jun 18, 2026
@cbl-bot

cbl-bot commented Jun 19, 2026

Copy link
Copy Markdown

Code Coverage Results:

Type Percentage
branches 64.6
functions 77.4
instantiations 71.03
lines 75.97
regions 72.28

@pasin
pasin merged commit 3dcb304 into release/4.1 Jun 19, 2026
12 of 13 checks passed
@pasin
pasin deleted the fix/mailbox-race-CBL-8475 branch June 19, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants