[HN Gopher] Debugging a Golang Bug with Non-Blocking Reads
       ___________________________________________________________________
        
       Debugging a Golang Bug with Non-Blocking Reads
        
       Author : memset
       Score  : 43 points
       Date   : 2024-03-11 17:26 UTC (1 days ago)
        
 (HTM) web link (scratchdata.com)
 (TXT) w3m dump (scratchdata.com)
        
       | chipaca wrote:
       | Step 1, create a named pipe, and open it in non-blocking mode.
       | 
       | ...
       | 
       | Unless things have changed a lot in this domain in the last few
       | years, that won't work reliably _anywhere_.
        
         | harikb wrote:
         | Go team does acknowledge [1] it as a bug, so there is some
         | point here
         | 
         | However, that said, I wonder if OP (duckdb) could have written
         | their solution [2] differently. Shouldn't they be able to
         | select from a Pipe as well as Error channel simultaneously?
         | (similar to how they are doing it inside here [3]). If not, I
         | would have create a go-routine that does blocking read on the
         | Pipe and then pass it on to another channel to select on.
         | 
         | [1] https://github.com/golang/go/issues/66239
         | 
         | [2]
         | https://github.com/scratchdata/scratchdata/blob/7c1a0fcd0e20...
         | 
         | [3]
         | https://github.com/scratchdata/scratchdata/blob/7c1a0fcd0e20...
        
         | o11c wrote:
         | Er, whyever wouldn't it? On Linux it certainly works as
         | expected, and it seems that it works fine on OS X when avoiding
         | the broken Go shims.
        
           | chipaca wrote:
           | I seem to remember non-blocking io with named pipes was
           | unreliable, in the sense that the test suite of whatever-it-
           | was (memory is reeealy sketchy, this was tens of years ago)
           | would fail randomly often enough that we had to throw the
           | easy solution away and do actual networking.
           | 
           | A bit like the .signature named pipe from fortune thing,
           | where sometimes you got two signatures and sometimes none?
           | Anybody remember that?
        
       ___________________________________________________________________
       (page generated 2024-03-12 23:01 UTC)