[Bugs] #1940 UNSP: failed registration breaks registration for the session

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu May 13 01:52:24 EDT 2010


#1940: failed registration breaks registration for the session
------------------------------------------+---------------------------------
    Reporter:  dsd                        |          Owner:  tomeu                      
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar                      |        Version:  Unspecified                
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------

Comment(by quozl):

 Thanks to a contributor, Python may be convinced to call res_init() again,
 and this is an unpleasant but working hack to fix the problem.

 The simplified test case that fails is:

  * use Sugar to disconnect network,
  * start Terminal,
  * start an instance of Python, and type interactively:
  {{{
 import socket
 host = 'schoolserver.example.com'
 port = 80
 x = socket.create_connection((host, port))
 }}}
  * observe the error in connecting to the host, it will be "Temporary
 failure in name resolution",
  * without terminating the Python instance, use Sugar to connect to the
 network,
  * repeat the connection attempt
  {{{
 x = socket.create_connection((host, port))
 }}}
  * observe that the problem persists.

 At this point, the unpleasant workaround can be used:
  * type the following into the Python instance to clear the cached
 resolver data:
  {{{
 import ctypes
 ctypes.CDLL('libc6.so.6').__res_init(None)
 }}}
  * repeat the connection attempt,
  {{{
 x = socket.create_connection((host, port))
 }}}
  * note that it is now successful.

 I'd like to know if this works as a temporary fix for deployments.  The
 two ctypes lines would be inserted in schoolserver.py prior to the call to
 ServerProxy().

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/1940#comment:5>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list