threatgrid / jqpipe-go

A Go Wrapper for JQ
BSD 2-Clause "Simplified" License
12 stars 8 forks source link

Race conditions on read #4

Open nicowilliams opened 9 years ago

nicowilliams commented 9 years ago

jqpipe-go might not find an entire JSON text from jq when it reads from the Pipe. This will cause jqpipe-go to think that jq is "sick" and kill it. The right thing to do is to buffer up more and try again.

Also, more than one JSON text might be read in one go!

The best fix is to revert #1 and always use -c and then you can do line-oriented reads.

andrewchambers commented 6 years ago

Are you sure this is the case? perhaps the code changed - but json.Decoder buffers data.