Giter VIP home page Giter VIP logo

Comments (7)

trourance avatar trourance commented on September 17, 2024

Ok, I've found the following line in the http.c:
CURL_SETOPT(g_http_handle, CURLOPT_CONNECTTIMEOUT, 1);

So it seems it's hardcoded and not allowed to be changed at runtime.

from pgsql-http.

trourance avatar trourance commented on September 17, 2024

Ok, I've changed that line to:
CURL_SETOPT(g_http_handle, CURLOPT_CONNECTTIMEOUT_MS, g_timeout_msec);

It seems to be enough for the moment to bypass my connection issue.

from pgsql-http.

pramsey avatar pramsey commented on September 17, 2024

I bumped that value way down early in development of the extension because having your backend hang until the 5 minute time-out ended seemed bad (tm). I wonder if curl has an interrupt checker, that could be a good enhancement. In the meanwhile, adding this parameter to the new list of settable parameters seems wise.

from pgsql-http.

pramsey avatar pramsey commented on September 17, 2024

The timeout is user-configurable now with commits from #48

from pgsql-http.

trourance avatar trourance commented on September 17, 2024

It makes sense not to keep the 300s default value. However, thanks for adding it as a user-configurable parameter.

from pgsql-http.

trourance avatar trourance commented on September 17, 2024

Something weird.
In a function, I set the following options:
SET http.timeout_msec TO 5000;
PERFORM http_set_curlopt('CURLOPT_CONNECTTIMEOUT', '5');
PERFORM http_set_curlopt('CURLOPT_TIMEOUT_MS', '5000');
Then I run SELECT content INTO v_content FROM http_get('someurl');

But I still get the following error message:
Connection timed out after 1000 milliseconds

from pgsql-http.

trourance avatar trourance commented on September 17, 2024

It seems that each time http_get_handle() function is called, it resets the CURLOPT_CONNECTTIMEOUT to 1.
So curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, 1); should only be called once at initialization.

from pgsql-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.