Repository navigation
Commit 7dd092e
committed
fix(core): inconsistency connection state
In the current version of the code, if a timeout value
less than or equal to 0 is passed, an exception is thrown,
but the connection remains stuck in the `CONNECTING` state.
Subsequent calls to the `Connection#connect(...)` method on
the same object return `null` instead of a proper
`CompletableFuture<Greeting>`.
In other words, failures or errors during the execution of
`Connection#connect(...)` should not leave the `Connection`
object in an inconsistent state. Subsequent calls should be
handled correctly; the method must return a
`CompletableFuture<Greeting>`—either one that completes
successfully or one that contains an error, as per the
contract of the `CompletionStage<T>` interface.1 parent 00205cd commit 7dd092e
2 files changed
Lines changed: 35 additions & 3 deletions
File tree
- tarantool-core/src
- main/java/io/tarantool/core/connection
- test/java/io/tarantool/core/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
393 | 424 | | |
394 | 425 | | |
395 | 426 | | |
| |||
0 commit comments