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

[Fix] Make userAgent.toString thread safe #348

Closed

Conversation

samikshya-db
Copy link
Contributor

@samikshya-db samikshya-db commented Sep 23, 2024

Changes

  • If we try load testing our JDBC driver with parallel select 1 queries, we get the following stack trace. This PR fixes the issue :
    Caused by: java.util.ConcurrentModificationException at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1715) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:702) at com.databricks.sdk.core.UserAgent.asString(UserAgent.java:125) at com.databricks.sdk.core.ApiClient.executeInner(ApiClient.java:256) at com.databricks.sdk.core.ApiClient.getResponse(ApiClient.java:235) at com.databricks.sdk.core.ApiClient.execute(ApiClient.java:227) at com.databricks.sdk.core.ApiClient.POST(ApiClient.java:164) at com.databricks.jdbc.dbclient.impl.sqlexec.DatabricksSdkClient.createSession(DatabricksSdkClient.java:99) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

Tests

  • Locally created a JAR file and the issue is not there now.

@samikshya-db samikshya-db changed the title Make userAgent.toString thread safe [Fix] Make userAgent.toString thread safe Sep 23, 2024
@samikshya-db samikshya-db marked this pull request as ready for review September 23, 2024 07:26
@mgyucht
Copy link
Contributor

mgyucht commented Oct 4, 2024

This has been done in another PR, sorry about that: #357.

@mgyucht mgyucht closed this Oct 4, 2024
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

Successfully merging this pull request may close these issues.

3 participants