Skip to content

CBL-8402 : Fix data race on SerialExecutor.currentThread#495

Merged
pasin merged 1 commit into
release/4.1from
CBL-8402
Jun 8, 2026
Merged

CBL-8402 : Fix data race on SerialExecutor.currentThread#495
pasin merged 1 commit into
release/4.1from
CBL-8402

Conversation

@pasin

@pasin pasin commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Make currentThread an AtomicLong so isInsideExecutor() reads a consistent, visible value across pool threads. Clear it with compareAndSet in the finally block so a task that has already claimed the thread for the next run is not cleared.

Make currentThread an AtomicLong so isInsideExecutor() reads a consistent, visible value across pool threads. Clear it with compareAndSet in the finally block so a task that has already claimed the thread for the next run is not cleared.
@github-actions

github-actions Bot commented Jun 8, 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)

@pasin

pasin commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Fix an issue reported by QE for 4.1.0.

@pasin
pasin requested a review from borrrden June 8, 2026 05:17
@pasin
pasin merged commit e095fd4 into release/4.1 Jun 8, 2026
1 check passed
@pasin
pasin deleted the CBL-8402 branch June 8, 2026 23:43
borrrden added a commit that referenced this pull request Jul 1, 2026
* Fix the tests to pass with the addition of crash logging (#493)

* CBL-8402 : Fix data race on SerialExecutor.currentThread (#495)

Make currentThread an AtomicLong so isInsideExecutor() reads a consistent, visible value across pool threads. Clear it with compareAndSet in the finally block so a task that has already claimed the thread for the next run is not cleared.

* CBL-8389 : Fix build and static analysis issues in kt-serialization API changes (#498)

* Replace var with explicit FLDict type in Document.setContent (common is compiled at Java 8)
* Suppress PMD SingularField and SpotBugs URF_UNREAD_FIELD on Document.extraBackingStore (keep-alive field)
* Add null check on FLValue.fromData() result in Document.setContent (NP_NULL_ON_SOME_PATH)
* Move serialization tests from test/java to test/kotlin so that only the android-ktx test builds compile them :
    - FleeceSerializationTest.kt moved as-is
    - ResultTest.kt renamed to ResultSerializationTest.kt
    - Serialization test and TestModel extracted from CollectionTest.kt into new CollectionSerializationTest.kt

* Fix incoming BLE L2CAP socket double-free on connection teardown (#499)

btAttached() (incoming) now calls c4socket_retain, matching btOpen(), to balance the c4socket_release in NativeC4Socket_closed. Without it the incoming socket was double-freed on teardown (SIGABRT, invalid refCount -6666666).

---------

Co-authored-by: Pasin Suriyentrakorn <pasin@couchbase.com>
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.

2 participants