Log filled with "join and sleep" messages.

Bug #1298258 reported by Ronald Portier (Therp)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned
OpenERP Community Backports (Server)
New
Undecided
Unassigned

Bug Description

Sometimes when stopping the server some threads are not shutting down, and the log is filled with "join and sleep" messages that are sent every tenth of a second.

The problematic part of the code is in openerp/service/__init__.py:

 97 def stop_services():
 98 """ Stop all services. """
 99 # stop services
100 cron.stop_service()
101 netrpc_server.stop_service()
102 wsgi_server.stop_service()
103
104 _logger.info("Initiating shutdown")
105 _logger.info("Hit CTRL-C again or send a second signal to force the shutdown.")
106
107 # Manually join() all threads before calling sys.exit() to allow a second signal
108 # to trigger _force_quit() in case some non-daemon threads won't exit cleanly.
109 # threading.Thread.join() should not mask signals (at least in python 2.5).
110 me = threading.currentThread()
111 _logger.debug('current thread: %r', me)
112 for thread in threading.enumerate():
113 _logger.debug('process %r (%r)', thread, thread.isDaemon())
114 if thread != me and not thread.isDaemon() and thread.ident != main_thread_id:
115 while thread.isAlive():
116 _logger.debug('join and sleep')
117 # Need a busyloop here as thread.join() masks signals
118 # and would prevent the forced shutdown.
119 thread.join(0.05)
120 time.sleep(0.05)
121
122 _logger.debug('--')
123 openerp.modules.registry.RegistryManager.delete_all()
124 logging.shutdown()

Apart from the problem that the server does not shut down properly, something should be done about the message volley fired into the log.

Related branches

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.