Log filled with "join and sleep" messages.
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/
97 def stop_services():
98 """ Stop all services. """
99 # stop services
100 cron.stop_service()
101 netrpc_
102 wsgi_server.
103
104 _logger.
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.
110 me = threading.
111 _logger.
112 for thread in threading.
113 _logger.
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.
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
- Holger Brunn (Therp): Disapprove
-
Diff: 31 lines (+12/-1)1 file modifiedopenerp/service/__init__.py (+12/-1)
- OpenERP Core Team: Pending requested
-
Diff: 31 lines (+12/-1)1 file modifiedopenerp/service/__init__.py (+12/-1)