Skip to content

feat(core): await connect-time requests before subscribe#102

Merged
MaxSiominDev merged 1 commit into
masterfrom
TNTP-8346-await-connection-ready
Jun 26, 2026
Merged

feat(core): await connect-time requests before subscribe#102
MaxSiominDev merged 1 commit into
masterfrom
TNTP-8346-await-connection-ready

Conversation

@MaxSiominDev

@MaxSiominDev MaxSiominDev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

I haven't forgotten about:

  • Tests
  • Changelog
  • Documentation
    • JavaDoc was written
  • Commit messages comply with the guideline
  • Cleanup the code for review. See checklist

Related issues:

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a connection-readiness barrier so callers can block until the initial IPROTO_ID exchange and connect-time watcher subscriptions are acknowledged, preventing early usage from racing with connect-time requests.

Changes:

  • Add a registered() completion signal to WatcherStateMachine that completes on the first successful watch response (or exceptionally on error/kill/send failure).
  • Add IProtoClient.awaitConnectionReady() and implement it in IProtoClientImpl by joining on server protocol negotiation + watcher registration futures.
  • Add unit/integration tests validating watcher registration completion and that awaitConnectionReady() does not hang.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tarantool-core/src/main/java/io/tarantool/core/protocol/fsm/WatcherStateMachine.java Tracks watcher “registered” completion and fails it on errors/kill/send failure.
tarantool-core/src/main/java/io/tarantool/core/IProtoClientImpl.java Implements awaitConnectionReady() by waiting for connect-time async futures to complete.
tarantool-core/src/main/java/io/tarantool/core/IProtoClient.java Adds new blocking API awaitConnectionReady().
tarantool-core/src/test/java/io/tarantool/core/protocol/fsm/WatcherStateMachineTest.java New unit tests for watcher registration completion (note: currently uses Java 9+ APIs).
tarantool-core/src/test/java/io/tarantool/core/integration/IProtoClientWatchersTest.java Integration test ensuring awaitConnectionReady() completes promptly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MaxSiominDev MaxSiominDev force-pushed the TNTP-8346-await-connection-ready branch from 6fa6cef to 8002fdf Compare June 24, 2026 00:53
@MaxSiominDev MaxSiominDev requested a review from Alex-pvl June 24, 2026 11:21
@MaxSiominDev MaxSiominDev marked this pull request as ready for review June 24, 2026 11:51
Comment thread tarantool-core/src/main/java/io/tarantool/core/IProtoClient.java Outdated
Comment thread tarantool-core/src/main/java/io/tarantool/core/IProtoClient.java Outdated
@MaxSiominDev MaxSiominDev force-pushed the TNTP-8346-await-connection-ready branch from 8002fdf to 465da2e Compare June 24, 2026 14:15
@MaxSiominDev MaxSiominDev requested a review from Alex-pvl June 24, 2026 14:15
@MaxSiominDev MaxSiominDev force-pushed the TNTP-8346-await-connection-ready branch from 465da2e to 759400e Compare June 25, 2026 09:07
@MaxSiominDev MaxSiominDev merged commit 6912215 into master Jun 26, 2026
14 of 16 checks passed
@MaxSiominDev MaxSiominDev deleted the TNTP-8346-await-connection-ready branch June 26, 2026 10:47
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.

4 participants