Open exaSR opened 9 months ago
@bednar - looks like we are re-using the AuthenticateInterceptor
causing problems with re-use. Can you confirm?
The issue is caused by reusing the OkHttpClient.Builder
. The AuthenticateInterceptor
is attached to the OkHttpClient.Builder
, and when InfluxDBClientOptions
is used for creating multiple client instances, they all end up using the same interceptor. We need to devise a method to ensure a unique OkHttpClient.Builder
for each client instance in cases where the user has not specified their own.
any updates?
@ycherabai, unfortunately not. However, would you be interested in assisting with this? We welcome all PRs and would be glad to review your contribution.
Steps to reproduce: List the minimal actions needed to reproduce the behavior.
(see example code below)
Expected behavior: Each connection is independent, performs as expected and does not trigger any unexpected warnings
Actual behavior: Each connection is independent, performs as expected. However, querying the second connection results in a log-warning:
As far as my debugging attempts got me, the reason is that the same
AuthenticateInterceptor
object is reused for multiple connections, and itssignout
flag is set when the first connection is closed, but is never reset for the second connection...Specifications:
Example Code: The actual code is connecting to different organizations and different users, so any recommendation to just reuse the client is not helpful.