Commit 1c488b47 authored by Jim Fulton's avatar Jim Fulton

Added logic to avoid spurious errors from the logging system on exit.

parent 31ff626a
...@@ -35,7 +35,7 @@ Blobs ...@@ -35,7 +35,7 @@ Blobs
use from a few kilobytes to at least multiple hundred megabytes. use from a few kilobytes to at least multiple hundred megabytes.
What's new on ZODB 3.7.0b3? What's new on ZODB 3.7.0b4?
=========================== ===========================
Packaging Packaging
...@@ -56,6 +56,9 @@ Packaging ...@@ -56,6 +56,9 @@ Packaging
ClientStorage ClientStorage
------------- -------------
- (3.7b4) Added logic to avoid spurious errors from the logging system
on exit.
- (3.7b2) Removed the "sync" mode for ClientStorage. - (3.7b2) Removed the "sync" mode for ClientStorage.
Previously, a ClientStorage could be in either "sync" mode or "async" Previously, a ClientStorage could be in either "sync" mode or "async"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# #
############################################################################## ##############################################################################
import asyncore import asyncore
import atexit
import errno import errno
import select import select
import sys import sys
...@@ -39,6 +40,7 @@ client_timeout_count = 0 # for testing ...@@ -39,6 +40,7 @@ client_timeout_count = 0 # for testing
client_map = {} client_map = {}
client_trigger = trigger(client_map) client_trigger = trigger(client_map)
client_logger = logging.getLogger('ZEO.zrpc.client_loop') client_logger = logging.getLogger('ZEO.zrpc.client_loop')
atexit.register(client_map.clear)
def client_loop(): def client_loop():
map = client_map map = client_map
...@@ -106,8 +108,13 @@ def client_loop(): ...@@ -106,8 +108,13 @@ def client_loop():
_exception(obj) _exception(obj)
except: except:
if map:
try:
client_logger.critical('The ZEO cient loop failed.', client_logger.critical('The ZEO cient loop failed.',
exc_info=sys.exc_info()) exc_info=sys.exc_info())
except:
pass
for fd, obj in map.items(): for fd, obj in map.items():
if obj is client_trigger: if obj is client_trigger:
continue continue
...@@ -115,8 +122,11 @@ def client_loop(): ...@@ -115,8 +122,11 @@ def client_loop():
obj.mgr.client.close() obj.mgr.client.close()
except: except:
map.pop(fd, None) map.pop(fd, None)
try:
client_logger.critical("Couldn't close a dispatcher.", client_logger.critical("Couldn't close a dispatcher.",
exc_info=sys.exc_info()) exc_info=sys.exc_info())
except:
pass
client_thread = threading.Thread(target=client_loop) client_thread = threading.Thread(target=client_loop)
client_thread.setDaemon(True) client_thread.setDaemon(True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment