ion-java
ion-java copied to clipboard
Consider adding an opt-in "debug mode" IonValue implementation
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.