Re: [PATCH] http client timeouts part1 (v4)
Enver ALTIN <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | Parkyeri |
| Message-ID | <[email protected]> |
On Fri, 2004-12-10 at 11:56 +0100, Alexander Malysh wrote:
> Hi,
Hi Alex,
> attached you can find a final version of this patch. This patch was tested
> with all possible stress tests and production systsem.
> For full description what this patch does:
> http://www.mail-archive.com/devel%40kannel.org/msg03831.html
> Changes since v3:
> - Fixed deadlock on conn_pool_lock mutex (Thanks to Enver for testing!!!).
It works fairly well on Linux, but I did another quick test on Solaris.
It looks like the TCP stack of Solaris 2.8 is a bit broken. If the other
end of the TCP connection is close()d, it doesn't look like our end gets
closed too. So we end up with having loads of CLOSE_WAIT TCP
connections, as per `netstat` shows.
I'm still running out of file-descriptors in smsbox, when the connection
to the URL specified on dlr-url/post-url times out somehow (not really
sure about this); and when DLRs/messages keep coming from SMSC.
So we either need to have a limit on concurrent HTTP client connections,
or do something else to prevent this:
2004-12-10 19:58:07 [1437] [9] ERROR: Couldn't create new socket.
2004-12-10 19:58:07 [1437] [9] ERROR: System error 24: Too many open files
2004-12-10 19:58:07 [1437] [9] ERROR: error connecting to server `10.200.106.38' at port `8080'
2004-12-10 19:58:07 [1437] [9] DEBUG: HTTP: Opening connection to `10.200.106.38:8080' (fd=0).
2004-12-10 19:58:07 [1437] [9] ERROR: Couldn't send request to <http://10.1.1.1:8080/dlr.php?status=16&msgid=280927>
and also this:
2004-12-10 19:59:16 [1437] [3] INFO: sendsms used by <test>
2004-12-10 19:59:16 [1437] [3] INFO: sendsms sender:<test:2345> (10.1.1.1) to:<1234567> msg:<*** message here ***>
2004-12-10 19:59:16 [1437] [2] ERROR: HTTP: Error accepting a client.
2004-12-10 19:59:16 [1437] [2] ERROR: System error 24: Too many open files
2004-12-10 19:59:16 [1437] [3] DEBUG: message length 160, sending 1 messages
2004-12-10 19:59:16 [1437] [3] DEBUG: Status: 202 Answer: <Sent.>
2004-12-10 19:59:16 [1437] [3] DEBUG: HTTP: Resetting HTTPClient for `10.1.1.1'.
2004-12-10 19:59:16 [1437] [3] DEBUG: HTTP: No clients with requests, quitting.
2004-12-10 19:59:16 [1437] [3] DEBUG: Thread 3 (gw/smsbox.c:sendsms_thread) terminates.
2004-12-10 19:59:16 [1437] [1] PANIC: gwlib/http.c:1933: port_put_request: Assertion `p != NULL' failed.
if I understand the problem right, but just because of too much coffee
and beer, I may be wrong.
It looks like HTTP server causes a panic() if it just can't accept() a
new connection, which may not be a good idea in all cases, because, as
it shows, it causes smsbox to terminate.
Alex, please advise if this explanation means something for you. I think
I'm getting lost in the gwlib/http.c :)
Cheers,
--
Enver ALTIN | http://skyblue.gen.tr/
Software developer @ Parkyeri | http://www.parkyeri.com/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBvDvRZCB2FZvqK0sRAhnXAJ98yhYJRV7m0sT39ElR71RAs+S7tACfeUkI f+zPcHtl9DhmMlaYy4QvkUo= =3aCZ -----END PGP SIGNATURE-----