Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tgregg opened this issue May 7, 2024 · 1 comment
Open

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

tgregg opened this issue May 7, 2024 · 1 comment

Comments

@tgregg
Copy link
Contributor

tgregg commented May 7, 2024

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.

@jobarr-amzn
Copy link
Contributor

Crazy idea but If we could introduce readonly/mutable types internally, then we could have a com.amaon.ion...not.thread.safe...IonStructLite or the like - make things more obvious as issues are encountered.

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

No branches or pull requests

2 participants