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

JAVA-3166: Enhanced exception handling of C* driver executeAsync() #1370

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

lukasz-antoniak
Copy link
Contributor

@lukasz-antoniak lukasz-antoniak commented Aug 26, 2024

Handling of exceptions that may be thrown by CqlSession#executeAsync(). Otherwise semaphore in AsyncExecutor is not released and processing of further tasks blocked.

Fixes: JAVA-3166

  • Shall I create a new ticket under SPARKC project?
  • I have performed a self-review of my own code
  • Locally all tests pass (make sure tests fail without your patch)

@@ -41,7 +40,16 @@ class AsyncExecutor[T, R](asyncAction: T => CompletionStage[R], maxConcurrentTas
val executionTimestamp = System.nanoTime()

def tryFuture(): Future[R] = {
val value = asyncAction(task)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something more Scala'ish - Try { ... } map { ... } ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Copy link
Contributor

@jacek-lewandowski jacek-lewandowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 once the tests pass

@jtgrabowski jtgrabowski merged commit c337831 into datastax:master Aug 27, 2024
10 checks passed
tarzanek pushed a commit to tarzanek/spark-scylladb-connector that referenced this pull request Aug 28, 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