feat(core): await connect-time requests before subscribe#102
Merged
Conversation
869fdba to
6fa6cef
Compare
There was a problem hiding this comment.
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 toWatcherStateMachinethat completes on the first successful watch response (or exceptionally on error/kill/send failure). - Add
IProtoClient.awaitConnectionReady()and implement it inIProtoClientImplby 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.
6fa6cef to
8002fdf
Compare
Alex-pvl
requested changes
Jun 24, 2026
8002fdf to
465da2e
Compare
Alex-pvl
reviewed
Jun 25, 2026
465da2e to
759400e
Compare
Alex-pvl
approved these changes
Jun 25, 2026
bitgorbovsky
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I haven't forgotten about:
Related issues: