- Notifications
You must be signed in to change notification settings - Fork5.1k
Commit902c088
committed
pgbench: Fail cleanly when finding a COPY result state
Currently, pgbench aborts when a COPY response is received inreadCommandResponse(). However, as PQgetResult() returns an emptyresult when there is no asynchronous result, through getCopyResult(),the logic done at the end of readCommandResponse() for the error pathleads to an infinite loop.This commit forcefully exits the COPY state with PQendcopy() beforemoving to the error handler when fiding a COPY state, avoiding theinfinite loop. The COPY protocol is not supported by pgbench anyway, asan error is assumed in this case, so giving up is better than having thetool be stuck forever. pgbench was interruptible in this state.A TAP test is added to check that an error happens if trying to useCOPY.Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>Discussion:https://postgr.es/m/CAO6_XqpHyF2m73ifV5a=5jhXxH2chk=XrgefY+eWWPe2Eft3=A@mail.gmail.comBackpatch-through: 131 parent25a30bb commit902c088
2 files changed
+25
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3359 | 3359 |
| |
3360 | 3360 |
| |
3361 | 3361 |
| |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
3362 | 3376 |
| |
3363 | 3377 |
| |
3364 | 3378 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1810 | 1810 |
| |
1811 | 1811 |
| |
1812 | 1812 |
| |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
1813 | 1824 |
| |
1814 | 1825 |
| |
1815 | 1826 |
| |
|
0 commit comments
Comments
(0)