Menu

#34 Current timeout is very long

0.8.0
closed
None
5
2015-01-23
2014-10-10
No

The current socket-based timeout (self.timeout in httplib.HTTP(S)Connection) is very long.

Trying to set a shorter time with socket.setdefaulttimeout() has the issue that the actual timeout is sometimes much longer than the specified timeout.

This could be addressed by adding a timer-based timeout, for example by setting it in the HTTP(S)Connection constructor which causes it to be set on the socket of the HTTP connection, and by starting a timer in parallel that causes the socket of the HTTP connection to be shut down when it expires.

The timeout should become a new optional parameter on WBEMConnection, with some sensible default value (e.g. 60 sec).

Discussion

  • Andreas Maier

    Andreas Maier - 2015-01-22
    • Type: --> Bug
     
  • Andreas Maier

    Andreas Maier - 2015-01-22
    • Milestone: Bug --> 0.8.0
     
  • Andreas Maier

    Andreas Maier - 2015-01-23

    Implemented a timer-based timeout that shuts down the connection socket if it expires. In addition, the timeout is set on the HTTP connection object which sets it on the socket object. Since using M2Crypto, that only works for http, but not for https. So for https, the timer-based socket shutdown is the only approach at the moment.

    The timeout situation comes back as a pywbem.TimeoutError exception, and in case of http also in some situations as pywbem.ConnectionError with a socket error "timeout".

    The fix has been committed as r728.

     
  • Andreas Maier

    Andreas Maier - 2015-01-23
    • status: open --> closed
     
MongoDB Logo MongoDB