Difference between revisions of "User:StasFomin/Bugs/SubscriptionManager/Timeout"

From Wiki4Intranet
Jump to: navigation, search
Line 45: Line 45:
 
             self._timeout = -1.0   
 
             self._timeout = -1.0   
 
</code-python>
 
</code-python>
 
 
Set timeout to -1 because global (socket) timeout not set
 
 
        self._timeout = self.socket.gettimeout()
 
        if self._timeout is None:
 
            self._timeout = -1.0 
 
  
 
On /usr/lib64/python2.6/site-packages/rhsm/connection.py
 
On /usr/lib64/python2.6/site-packages/rhsm/connection.py

Revision as of 16:45, 5 April 2016

Sometimes I see hangout of subscription-manager on connecting to Candlepin (on every operation, like «subscription-manager identity»).

#6 <built-in function ssl_connect>
#8 file '/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py', in 'connect_ssl'
#11 file '/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py', in 'connect'
#14 file '/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py', in 'connect'
#17 file '/usr/lib64/python2.6/httplib.py', in 'send'
#20 file '/usr/lib64/python2.6/httplib.py', in '_send_output'
#23 file '/usr/lib64/python2.6/httplib.py', in 'endheaders'
#26 file '/usr/lib64/python2.6/httplib.py', in '_send_request'
#29 file '/usr/lib64/python2.6/httplib.py', in 'request'
#33 file '/usr/lib64/python2.6/site-packages/rhsm/connection.py', in '_request'
#37 file '/usr/lib64/python2.6/site-packages/rhsm/connection.py', in 'request_get'
#40 file '/usr/lib64/python2.6/site-packages/rhsm/connection.py', in 'getStatus'
#43 file '/usr/share/rhsm/subscription_manager/utils.py', in 'get_server_versions'
#47 file '/usr/share/rhsm/subscription_manager/managercli.py', in 'log_server_version'
#50 file '/usr/share/rhsm/subscription_manager/managercli.py', in 'main'
#54 file '/usr/share/rhsm/subscription_manager/cli.py', in 'main'
#62 file '/usr/share/rhsm/subscription_manager/managercli.py', in 'main'
#65 file '/usr/sbin/subscription-manager', in 'main'
#68 file '/usr/sbin/subscription-manager', in '<module>'
(gdb) bt
#0  0x00007f858ca0f810 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f858458afb1 in ?? () from /usr/lib64/libcrypto.so.10
#2  0x00007f8584589309 in BIO_read () from /usr/lib64/libcrypto.so.10
#3  0x00007f85848c1873 in ssl23_read_bytes () from /usr/lib64/libssl.so.10
#4  0x00007f85848c07be in ssl23_connect () from /usr/lib64/libssl.so.10
#5  0x00007f8582a8b973 in ssl_connect () from /usr/lib64/python2.6/site-packages/M2Crypto/__m2crypto.so
#6  0x00007f8582a98b3b in ?? () from /usr/lib64/python2.6/site-packages/M2Crypto/__m2crypto.so
#7  0x00007f858ccf39d4 in call_function (f=<value optimized out>, throwflag=<value optimized out>) at Python/ceval.c:3794

I debug SM, and see, that in /usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py self._timeout set to -1, because self.socket.gettimeout() is None:

        self._timeout = self.socket.gettimeout()
        if self._timeout is None:
            self._timeout = -1.0   

On /usr/lib64/python2.6/site-packages/rhsm/connection.py I see attempt to set global timeout, but (why?) only for python <= 2.4

    if sys.version_info[0] == 2 and sys.version_info[1] < 4:
        socket.setdefaulttimeout(global_socket_timeout)
        timeout_altered = True
        return

Why global timeout is not set? Can it be set without patching subscription-manager?