You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came to notice, that the current Java Client is not thread safe for a couple of reasons:
It uses classes that do not support concurrency and yield incorrect results when accessed by multiple threads like HashMap (explanation here)and SimpleDateFormat (explanation here)
The results of the last API call are stored in fields inside ApiClient (statusCode and responseHeaders) - which might be overridden by a concurrent request. Accessing that information from the outside may cause incorrect results
I understand that fixing these issues may introduce breaking changes (although using ThreadLocal might be a replacement for statusCode and responseHeader fields) and might not be something to be considered now.
However, I would ask you to at least document the concurrency based limitations of the API client and point out the best way to use the client in a concurrent setup, like a web application.
Thanks a lot
The text was updated successfully, but these errors were encountered:
Thank you for highlighting these concurrency issues and for your patience.
We apologize for the delay in addressing this issue. Our team had updated the documentation back in March 2022, but updating this GitHub issue got missed.
Hi Everyone,
I came to notice, that the current Java Client is not thread safe for a couple of reasons:
I understand that fixing these issues may introduce breaking changes (although using ThreadLocal might be a replacement for statusCode and responseHeader fields) and might not be something to be considered now.
However, I would ask you to at least document the concurrency based limitations of the API client and point out the best way to use the client in a concurrent setup, like a web application.
Thanks a lot
The text was updated successfully, but these errors were encountered: