Skip to content

[fix-zip-observable] synchronize ZipObservable onComplete implementation#1

Merged
lpetka merged 1 commit intoseries/3.x-avsfrom
fix-zip-observable
May 20, 2025
Merged

[fix-zip-observable] synchronize ZipObservable onComplete implementation#1
lpetka merged 1 commit intoseries/3.x-avsfrom
fix-zip-observable

Conversation

@lpetka
Copy link
Copy Markdown

@lpetka lpetka commented May 13, 2025

ZipObservable implementations (all flavors Zip{2,3,4,5,6}Observable) uses shared state in multithreaded environment. There was a problem with underterministically non completing observables which was induced by the read of a non-volatile shared boolean without prior memory barrier.

I wasn't able to reproduce the problem on a current monix fork and the reason behind it is still unknown to me, although the major contributors might be:

  • different java / scala version
  • custom test executor with sophisticated ticking implementation

The problem is reproducing kinda well for a current DHCP implementation both in testing suites and production code (the executor provided for the observable is irrelevant there).

Playground: https://gitlab.avsystem.com/csp/dslam/dhcp/-/commit/ca08ccb46078c6f8e8cde3f1261d51527e2f39d1

…ions in order to avoid reading stale shared state in multithreaded environment
@lpetka lpetka merged commit 9289034 into series/3.x-avs May 20, 2025
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