Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-05-07 Thread Noah Misch
On Tue, Feb 11, 2014 at 03:43:08PM -0500, Tom Lane wrote: > While looking at the pending patch to make psql report a line count > after COPY, I came across this business in handleCopyOut(): > > * Check command status and return to normal libpq state. After a > * client-side error, the s

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > I was able to reproduce this misbehavior by setting a gdb breakpoint > at pqReadData and then killing the connected server process while psql's > COPY IN was stopped there. Resetting outCount to zero in the > socket-already-gone case in pqSendSome is enough

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Tom Lane
I wrote: >> Stephen Frost writes: >>> I've not gotten back to it yet, but I ran into a related-seeming issue >>> where psql would happily chew up 2G of memory trying to send "COPY >>> failed" notices when it gets disconnected from a server that it's trying >>> to send data to mid-COPY. conn->sock

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Tom Lane
I wrote: > Stephen Frost writes: >> I've not gotten back to it yet, but I ran into a related-seeming issue >> where psql would happily chew up 2G of memory trying to send "COPY >> failed" notices when it gets disconnected from a server that it's trying >> to send data to mid-COPY. conn->sock was

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > I've not gotten back to it yet, but I ran into a related-seeming issue > > where psql would happily chew up 2G of memory trying to send "COPY > > failed" notices when it gets disconnected from a server that it's trying > > to send

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Tom Lane
Stephen Frost writes: > I've not gotten back to it yet, but I ran into a related-seeming issue > where psql would happily chew up 2G of memory trying to send "COPY > failed" notices when it gets disconnected from a server that it's trying > to send data to mid-COPY. conn->sock was -1, connection

Re: [HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > While looking at the pending patch to make psql report a line count > after COPY, I came across this business in handleCopyOut(): > > * Check command status and return to normal libpq state. After a > * client-side error, the server will remain r

[HACKERS] Unhappy with error handling in psql's handleCopyOut()

2014-02-11 Thread Tom Lane
While looking at the pending patch to make psql report a line count after COPY, I came across this business in handleCopyOut(): * Check command status and return to normal libpq state. After a * client-side error, the server will remain ready to deliver data. The * cleanest thing