Commit c5691ee
committed
fix: recalculate remaining statement timeout after retry
If a connection has a statement timeout and a statement is executed in a read/write
transaction, the statement timeout would be reset to the original value during each
retry, instead of being reduced after each attempt. This could cause multiple
transaction retries to make the execution of a single statement take much longer
than the configured timeout value.1 parent 468b7c0 commit c5691ee
File tree
4 files changed
+59
-6
lines changed- google-cloud-spanner/src
- main/java/com/google/cloud/spanner/connection
- test/java/com/google/cloud/spanner/connection
4 files changed
+59
-6
lines changedgoogle-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| |||
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
370 | 380 | | |
371 | | - | |
| 381 | + | |
372 | 382 | | |
373 | 383 | | |
374 | 384 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
586 | 611 | | |
587 | 612 | | |
588 | 613 | | |
| |||
google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiTest.java
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
538 | | - | |
539 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
540 | 549 | | |
541 | 550 | | |
542 | 551 | | |
| |||
577 | 586 | | |
578 | 587 | | |
579 | 588 | | |
580 | | - | |
581 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
582 | 599 | | |
583 | 600 | | |
584 | 601 | | |
| |||
0 commit comments