Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KSQL Query function is timing out but working fine in cli and curl

See original GitHub issue

When I make a ksql query using the ksql-cli and 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 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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

bryanyang0528commented, Jun 26, 2019

@olmul would you mind create a PR and share your work around solution?

KenCox94commented, Jul 23, 2022

@jacobcrawford this may be resolved with an upcoming release. Please advise after the update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot KSQL issues | Confluent Platform 4.1.0
Streaming queries don't stop unless you end them explicitly. In the KSQL CLI, press CTRL+C to stop a non-persistent query. To stop a...
Read more >
KSQL query not returning the response via REST API , even I ...
I have tried using the POSTMAN , curl options, but none of the option works . However from ksql-cli the same query is...
Read more >
Cannot create stream because getting timeout while ... - GitHub
I've found a workaround by using ksql.queries.file and running it in a Headless mode. It works for me as I don't really need...
Read more >
A Complete Guide to Timeouts in Node.js - Better Stack
Assigning timeout values prevents network operations in Node.js from blocking indefinitely. This article provides extensive instruction on how to time out ...
Read more >
Google Sheets Query function: Learn the most powerful ...
However, if you've ever used pivot tables in Google Sheets (or Excel) then you should be fine with this. The GROUP BY keyword...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found