HTTP SET OPTION timeout doesn't work?

Hi,

I’m making some tests with HTTP Request.

4D waits for HTTP Request to be finished and it can be very long.

So I want to set a timeout :

HTTP SET OPTION(HTTP timeout;2)

but it doesn’t change anything.
It still waits way too long.

I compared with curl v2 option :

$voCurlOptions.TIMEOUT:=2

which works really well.

Is this a bug or am I misusing the command ?

I think there is two types of timeout in curl.
A connect timeout and a timeout for the http response to complete.

In your case, with HTTP Request, there is only one timeout.
So in you situation, the http server is online ? or offline ?
Does it take too long to respond ?

HTH

My goal is to quickly check if a server is online and respond a 200 status to my request.
If not, I move on to the next one.

With HTTP Request, if the server is offline, 4D get stuck or has a strange behaviour (100% CPU).
With curl, if the server is offline, 4D waits 2 seconds and then continue, which is what I want.

Are you sending a very simple request to just see if the server is alive? If the server is not running at all, HTTP Request should return an immediate error. The only reason it should wait 2 seconds is if the server accepts the connection and takes 2 or more seconds to respond.

Indeed, if the server accepts the connection and takes 1 minute to respond, HTTP Request will wait 1 minute before continuing whereas, if I understand correctly, it should stop after 2 seconds.
Did you manage to successfully use HTTP Option(Timeout) ?

We’re having a very similar problem (using v17.4) - WEB SERVICE SET OPTION (Web Service HTTP timeout; 10) seems to be doing nothing - if the destination server is not available it’s still taking 180 seconds (the default timeout) - and it’s also basically freezing 4D (spinning beachball, etc)

Anyone else seeing this, not seeing it, etc?

bill

Well, I just reported a bug on taow : ACI0100807

Just tested with 18R2. If the destination server is not running, HTTP Status returns 0 and generates error number 30 immediately. But if the connection is accepted by the remote server, it does seem like 4D is not respecting the timeout value to abort the request. You should create a small test database and submit a bug report.