ion-java icon indicating copy to clipboard operation
ion-java copied to clipboard

Consider adding an opt-in "debug mode" IonValue implementation

Open tgregg opened this issue 9 months ago • 1 comments

Non-deterministic behavior when accessing IonValue instances from multiple threads is usually caused by violating the library's multi-threaded contract, which requires calling makeReadOnly in a single thread before initiating concurrent access. However, the symptoms can be hard to distinguish from those of legitimate bugs in ion-java. In order to assist in root-causing non-deterministic behavior, we could consider adding a "debug mode" IonValue implementation that can be temporarily enabled. This could record the threads that access each instance and determine whether concurrent access occurs before makeReadOnly has been invoked on the instance.

tgregg avatar May 07 '24 18:05 tgregg