Commit 175293d
committed
BUG#33761268: skip connection requests on unavailable pool
When a connection pool is full, any new connection request is retried
within a sliding window of time until it reaches the time specified by
the "queueTimeout" option. By default, the connection request will be
retried forever, until the connection is effectively acquired.
Currently, if the pool is closed in the meantime, all connection
requests that have been queued will still be retried in the future, as
long as the application process does not terminate. This is bad and
might result in dangling sockets and formal MySQL server connections,
which is a waste of resources and a potential source of memory leaks.
This patch introduces the changes necessary to ensure all queued
connection requests in a pool are skipped when the pool is closed or is
in the process of being closed (where it should still no longer be
available in order to avoid parallelism issues).1 parent 9b738dd commit 175293d
File tree
5 files changed
+231
-20
lines changed- lib/DevAPI
- test
- functional/default/connection
- unit/DevAPI
5 files changed
+231
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
134 | | - | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
171 | 188 | | |
172 | 189 | | |
173 | 190 | | |
| |||
247 | 264 | | |
248 | 265 | | |
249 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
250 | 278 | | |
251 | 279 | | |
252 | 280 | | |
| |||
270 | 298 | | |
271 | 299 | | |
272 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
273 | 304 | | |
274 | 305 | | |
275 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
660 | 678 | | |
661 | 679 | | |
662 | 680 | | |
| |||
675 | 693 | | |
676 | 694 | | |
677 | 695 | | |
| 696 | + | |
678 | 697 | | |
679 | 698 | | |
680 | 699 | | |
| |||
691 | 710 | | |
692 | 711 | | |
693 | 712 | | |
694 | | - | |
695 | | - | |
696 | | - | |
| 713 | + | |
697 | 714 | | |
698 | 715 | | |
699 | 716 | | |
| |||
704 | 721 | | |
705 | 722 | | |
706 | 723 | | |
| 724 | + | |
707 | 725 | | |
708 | 726 | | |
709 | 727 | | |
| |||
721 | 739 | | |
722 | 740 | | |
723 | 741 | | |
724 | | - | |
725 | | - | |
726 | | - | |
| 742 | + | |
727 | 743 | | |
728 | 744 | | |
729 | 745 | | |
| |||
799 | 815 | | |
800 | 816 | | |
801 | 817 | | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
802 | 867 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
92 | 107 | | |
93 | 108 | | |
94 | 109 | | |
| |||
0 commit comments