Commit 4c44321
committed
Avoid conn leak in prepared statements, better err handling
If a prepared statement was not recognized by the server (for
example, if it was restarted), connections were not being properly
returned to the pool.
Additionally, the re-submission of the original query after the
preparation completed was not borrowing connections properly
(by finding the least loaded conn and incrementing its in_flight
count).
Last, if there was a connection error while preparing an
unrecognized prepared statement, that error was raised directly
instead of retrying the operation on other hosts.1 parent 3bdcb0d commit 4c44321
2 files changed
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
1684 | 1690 | | |
1685 | 1691 | | |
1686 | 1692 | | |
1687 | 1693 | | |
1688 | | - | |
| 1694 | + | |
1689 | 1695 | | |
1690 | 1696 | | |
1691 | 1697 | | |
| |||
1791 | 1797 | | |
1792 | 1798 | | |
1793 | 1799 | | |
1794 | | - | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
1795 | 1803 | | |
1796 | | - | |
| 1804 | + | |
1797 | 1805 | | |
1798 | 1806 | | |
1799 | 1807 | | |
| |||
1846 | 1854 | | |
1847 | 1855 | | |
1848 | 1856 | | |
1849 | | - | |
1850 | | - | |
| 1857 | + | |
| 1858 | + | |
1851 | 1859 | | |
1852 | 1860 | | |
1853 | 1861 | | |
| |||
1860 | 1868 | | |
1861 | 1869 | | |
1862 | 1870 | | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
1863 | 1877 | | |
1864 | 1878 | | |
1865 | 1879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
| 369 | + | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
0 commit comments