Skip to content

fix: resolve sendQueryAfterCurrent race and map R2DBC timeout exceptions - #447

Merged
oshai merged 1 commit into
masterfrom
fix/issue-408-send-query-after-current
Nov 9, 2026
Merged

oshai merged 1 commit into
masterfrom
fix/issue-408-send-query-after-current

Conversation

@oshai

@oshai oshai commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Read queryPromise() atomically once in MySQLConnection.sendQueryAfterCurrent to eliminate the TOCTOU NoSuchElementException race when an in-flight query finishes concurrently with transaction cleanup.
  • Chain cleanup queries via flatMapTry so non-cancellation query failures (e.g. MySQLException) still execute ROLLBACK / SET AUTOCOMMIT instead of skipping cleanup or swallowing errors into null, while continuing to ignore CancellationException on subscriber cancellation.
  • Map java.util.concurrent.TimeoutException (and CompletionException-wrapped causes) to R2dbcTimeoutException in JasyncStatement.mapException and preserve the underlying exception message on fallback JasyncDatabaseException.

Fixes #408

@oshai
oshai merged commit 211b5b0 into master Nov 9, 2026
2 checks passed
@oshai
oshai deleted the fix/issue-408-send-query-after-current branch November 9, 2026 21:04
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.

[Bug] UncategorizedR2dbcException and NoSuchElementException detected.

1 participant