KSQL Query function is timing out but working fine in cli and curlSee original GitHub issue
When I make a ksql query using the
curl, It works fine. Making the same query using this library doesn’t work. After investigating the issue, it looks like the problem is how python requests library handles the results https://stackoverflow.com/a/28156068/4395533.
This quote from the stack overflow user larsks who answered the question summarises the problem
This behaviour is due to a buggy implementation of the iter_lines method in the requests library.
iter_lines iterates over the response content in chunk_size blocks of data using the iter_content > iterator. If there are less than chunk_size bytes of data available for reading from the remote > > server (which will typically be the case when reading the last line of output), the read operation > will block until chunk_size bytes of data are available
I made the same request in golang using the
net/http package the behaviour was the same so one could argue that the implementation of the clients making the requests is correct and its ksql that is returning results in a sub-optimal way.
Of course, the query works fine in curl and the workaround we are using is to make a call to curl through pythons subprocess library and then pipe the data back to our application. I guess that is a case for the issue being with how this library is handling responses
- Created 4 years ago
- Comments:8 (3 by maintainers)