Hi

I am experiencing a strange issue using an HTTP-based SMSC with Kannel
1.4.3. 

Due to some network issue we had a temporary problem opening connections
to the smsc. When sending an mt sms the gateway tries to open a
connection/socket to the smsc, but the operation times out after 5
seconds. So far all is normal. Then rather than simply give up, the
gateway tries to write the request data to the socket. Obviously this
fails and while cleaning up bearerbox panics in a call to
conn_unregister with a NULL connection.

I have tried to trace the calls, and as far as I can see this is what
happens:

http.c#handle_transaction the transaction state is set to  "connecting".
For some reason the conn_get_connect_result does not return an error, ad
consequently send_request is called.

http.c#send_request tries to write the request data to the connect, but
fails as the connection is dead. In the error handling send_request
calls conn_unregister and sets the transaction connection to NULL before
returning an error.

Back in handle_transaction the failed call to send_request causes
handle_transaction to do some error handling and cleanup - again calling
conn_unregister - this time with a NULL-connection causing the panic.

The cause of the problem must be the erronenous result from
conn_get_connect_result (which may be due to the fact that the gateway
is running under CygWin).

But even so, should both send_request and handle_transaction try to
clean up the connection? 

BR
  Jacob

2011-05-10 10:36:43 [37016] [11] DEBUG: Queue contains 0 pending requests.
2011-05-10 10:36:43 [37016] [11] DEBUG: Parsing URL `http://xxx:[email protected]/SendSmsService/7f3ca10c67c7b4c143e8392516f7fffc':
2011-05-10 10:36:43 [37016] [11] DEBUG:   Scheme: http://
2011-05-10 10:36:43 [37016] [11] DEBUG:   Host: xxx.xxx.xxx.xxx
2011-05-10 10:36:43 [37016] [11] DEBUG:   Port: 80
2011-05-10 10:36:43 [37016] [11] DEBUG:   Username: xxx
2011-05-10 10:36:43 [37016] [11] DEBUG:   Password: xxx
2011-05-10 10:36:43 [37016] [11] DEBUG:   Path: /SendSmsService
2011-05-10 10:36:43 [37016] [11] DEBUG:   Query: (null)
2011-05-10 10:36:43 [37016] [11] DEBUG:   Fragment: (null)
2011-05-10 10:36:43 [37016] [11] DEBUG: Connecting nonblocking to <xxx.xxx.xxx.xxx>
2011-05-10 10:36:43 [37016] [11] DEBUG: HTTP: Opening connection to `xxx.xxx.xxx.xxx:80' (fd=44).
2011-05-10 10:36:43 [37016] [11] DEBUG: Socket connecting
2011-05-10 10:36:48 [37016] [10] DEBUG: Timeout for fd:44 appeares.
2011-05-10 10:36:48 [37016] [10] DEBUG: Get info about connecting socket
2011-05-10 10:36:48 [37016] [10] DEBUG: HTTP: Sending request:
2011-05-10 10:36:48 [37016] [10] DEBUG: Octet string at 0x10c9aa8:
2011-05-10 10:36:48 [37016] [10] DEBUG:   len:  1028
2011-05-10 10:36:48 [37016] [10] DEBUG:   size: 2048
2011-05-10 10:36:48 [37016] [10] DEBUG:   immutable: 0
...
2011-05-10 10:36:48 [37016] [10] DEBUG: Octet string dump ends.
2011-05-10 10:36:48 [37016] [10] ERROR: Error writing 1028 octets to fd 44:
2011-05-10 10:36:48 [37016] [10] ERROR: System error 128: Transport endpoint is not connected
2011-05-10 10:36:48 [37016] [10] ERROR: Error writing 1028 octets to fd 44:
2011-05-10 10:36:48 [37016] [10] ERROR: System error 128: Transport endpoint is not connected
2011-05-10 10:36:48 [37016] [10] ERROR: Couldn't send request to <http://xxx:[email protected]/SendSmsService>
2011-05-10 10:36:48 [37016] [10] DEBUG: Failed while sending request
2011-05-10 10:36:48 [37016] [10] PANIC: gwlib/conn.c:852: conn_unregister: Assertion `conn != NULL' failed.

Reply via email to