Commit e75a281
feat: move session lastUseTime parameter from PooledSession to SessionImpl class. Fix updation of the parameter for chained RPCs within one transaction. (#2704)
* fix: prevent illegal negative timeout values into thread sleep() method while retrying exceptions in unit tests.
* For details on issue see - #2206
* Fixing lint issues.
* refactor: move session lastUseTime parameter from PooledSession to SessionImpl class. Fix updation of the parameter for chained RPCs within one transaction.
* chore: add clock instances in callees of SessionImpl.
* chore: partially fix failing unit tests in SessionPoolTest and SessionPoolMaintainerTest.
* chore: fix failing tests in SessionPoolStressTest.
* chore: update lastUseTime for methods in SessionPoolTransactionContext. Add a couple of unit tests for testing the new behaviour.
* chore: lint errors.
* chore: fix tests in DatabaseClientImplTest by passing the mocked clock instance.
* fix: update session lastUseTime field for AbstractReadContext class. Fix the unit test to test this change.
* fix: failing tests in TransactionRunnerImplTest.
* fix: failing test in SessionPoolMaintainerTest.
* refactor: move FakeClock to a new class.
* refactor: move Clock to a new class.
* chore: resolving PR comments.
* chore: address review comments.
* chore: updating lastUseTime state in TransactionRunnerImpl. Removing redundant updates from SessionPool class.
* chore: remove redundant update statements from SessionPool class. Add more unit tests.
* chore: add more tests for TransactionRunner.
* chore: remove dead code from constructor of SessionPoolTransactionContext.
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Co-authored-by: Knut Olav Løite <[email protected]>
* Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Co-authored-by: Knut Olav Løite <[email protected]>
* Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Co-authored-by: Knut Olav Løite <[email protected]>
* chore: fixing precondition errors due to null clock.
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>1 parent e320753 commit e75a281
File tree
13 files changed
+1009
-112
lines changed- google-cloud-spanner/src
- main/java/com/google/cloud/spanner
- test/java/com/google/cloud/spanner
13 files changed
+1009
-112
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
| |||
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
| 402 | + | |
| 403 | + | |
395 | 404 | | |
396 | 405 | | |
397 | 406 | | |
| |||
416 | 425 | | |
417 | 426 | | |
418 | 427 | | |
| 428 | + | |
419 | 429 | | |
420 | 430 | | |
421 | 431 | | |
| |||
689 | 699 | | |
690 | 700 | | |
691 | 701 | | |
| 702 | + | |
692 | 703 | | |
693 | 704 | | |
694 | 705 | | |
| |||
826 | 837 | | |
827 | 838 | | |
828 | 839 | | |
| 840 | + | |
829 | 841 | | |
830 | 842 | | |
831 | 843 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
| |||
385 | 396 | | |
386 | 397 | | |
387 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
388 | 402 | | |
389 | 403 | | |
390 | 404 | | |
| |||
396 | 410 | | |
397 | 411 | | |
398 | 412 | | |
| 413 | + | |
399 | 414 | | |
400 | 415 | | |
401 | 416 | | |
| |||
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 147 | | |
158 | 148 | | |
159 | 149 | | |
| |||
1370 | 1360 | | |
1371 | 1361 | | |
1372 | 1362 | | |
1373 | | - | |
1374 | 1363 | | |
1375 | 1364 | | |
1376 | 1365 | | |
| |||
1409 | 1398 | | |
1410 | 1399 | | |
1411 | 1400 | | |
1412 | | - | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1413 | 1404 | | |
1414 | 1405 | | |
1415 | 1406 | | |
| |||
1631 | 1622 | | |
1632 | 1623 | | |
1633 | 1624 | | |
1634 | | - | |
| 1625 | + | |
1635 | 1626 | | |
1636 | 1627 | | |
1637 | 1628 | | |
| |||
1827 | 1818 | | |
1828 | 1819 | | |
1829 | 1820 | | |
1830 | | - | |
| 1821 | + | |
1831 | 1822 | | |
1832 | 1823 | | |
1833 | 1824 | | |
| |||
1929 | 1920 | | |
1930 | 1921 | | |
1931 | 1922 | | |
1932 | | - | |
| 1923 | + | |
| 1924 | + | |
1933 | 1925 | | |
1934 | 1926 | | |
1935 | 1927 | | |
| |||
2327 | 2319 | | |
2328 | 2320 | | |
2329 | 2321 | | |
2330 | | - | |
| 2322 | + | |
2331 | 2323 | | |
2332 | 2324 | | |
2333 | 2325 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
| |||
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
197 | 205 | | |
198 | 206 | | |
| 207 | + | |
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
| |||
389 | 398 | | |
390 | 399 | | |
391 | 400 | | |
| 401 | + | |
392 | 402 | | |
393 | 403 | | |
394 | 404 | | |
| |||
463 | 473 | | |
464 | 474 | | |
465 | 475 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
472 | 485 | | |
473 | 486 | | |
474 | 487 | | |
| |||
723 | 736 | | |
724 | 737 | | |
725 | 738 | | |
| 739 | + | |
726 | 740 | | |
727 | 741 | | |
728 | 742 | | |
| |||
753 | 767 | | |
754 | 768 | | |
755 | 769 | | |
| 770 | + | |
756 | 771 | | |
757 | 772 | | |
758 | 773 | | |
| |||
824 | 839 | | |
825 | 840 | | |
826 | 841 | | |
| 842 | + | |
827 | 843 | | |
828 | 844 | | |
829 | 845 | | |
| |||
863 | 879 | | |
864 | 880 | | |
865 | 881 | | |
| 882 | + | |
866 | 883 | | |
867 | 884 | | |
868 | 885 | | |
| |||
0 commit comments