Commit 794ddc9d authored by Jim Fulton's avatar Jim Fulton

Bugs Fixed

----------

- ZEO client threads were unnamed, making it hard to debug thread
  management.
parent fb02f228
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
Change History Change History
================ ================
3.9.0b2 (2009-07-02)
====================
Bugs Fixed
----------
- ZEO client threads were unnamed, making it hard to debug thread
management.
3.9.0b2 (2009-06-11) 3.9.0b2 (2009-06-11)
==================== ====================
......
...@@ -1174,6 +1174,12 @@ def open_convenience(): ...@@ -1174,6 +1174,12 @@ def open_convenience():
>>> db.close() >>> db.close()
""" """
def client_asyncore_thread_has_name():
"""
>>> len([t for t in threading.enumerate()
... if t.getName() == 'ZEO.zrpc.connection'])
1
"""
slow_test_classes = [ slow_test_classes = [
BlobAdaptedFileStorageTests, BlobWritableCacheTests, BlobAdaptedFileStorageTests, BlobWritableCacheTests,
......
...@@ -47,7 +47,7 @@ def client_exit(): ...@@ -47,7 +47,7 @@ def client_exit():
global client_running global client_running
client_running = False client_running = False
client_trigger.pull_trigger() client_trigger.pull_trigger()
client_exit_event.wait() client_exit_event.wait(99)
atexit.register(client_exit) atexit.register(client_exit)
...@@ -61,10 +61,10 @@ def client_loop(): ...@@ -61,10 +61,10 @@ def client_loop():
client_exit_event.clear() client_exit_event.clear()
global client_running global client_running
client_running = True client_running = True
while client_running and map: while client_running and map:
try: try:
# The next two lines intentionally don't use # The next two lines intentionally don't use
# iterators. Other threads can close dispatchers, causeing # iterators. Other threads can close dispatchers, causeing
# the socket map to shrink. # the socket map to shrink.
...@@ -87,7 +87,7 @@ def client_loop(): ...@@ -87,7 +87,7 @@ def client_loop():
continue continue
if [fd for fd in w if fd not in map]: if [fd for fd in w if fd not in map]:
continue continue
raise raise
else: else:
continue continue
...@@ -153,7 +153,7 @@ def client_loop(): ...@@ -153,7 +153,7 @@ def client_loop():
client_exit_event.set() client_exit_event.set()
client_thread = threading.Thread(target=client_loop) client_thread = threading.Thread(target=client_loop, name=__name__)
client_thread.setDaemon(True) client_thread.setDaemon(True)
client_thread.start() client_thread.start()
# #
...@@ -344,7 +344,7 @@ class Connection(smac.SizedMessageAsyncConnection, object): ...@@ -344,7 +344,7 @@ class Connection(smac.SizedMessageAsyncConnection, object):
# restorea, iterator_start, iterator_next, # restorea, iterator_start, iterator_next,
# iterator_record_start, iterator_record_next, # iterator_record_start, iterator_record_next,
# iterator_gc # iterator_gc
# Protocol variables: # Protocol variables:
# Our preferred protocol. # Our preferred protocol.
current_protocol = "Z309" current_protocol = "Z309"
...@@ -548,7 +548,7 @@ class Connection(smac.SizedMessageAsyncConnection, object): ...@@ -548,7 +548,7 @@ class Connection(smac.SizedMessageAsyncConnection, object):
def handle_request(self, msgid, flags, name, args): def handle_request(self, msgid, flags, name, args):
obj = self.obj obj = self.obj
if name.startswith('_') or not hasattr(obj, name): if name.startswith('_') or not hasattr(obj, name):
if obj is None: if obj is None:
if __debug__: if __debug__:
...@@ -556,7 +556,7 @@ class Connection(smac.SizedMessageAsyncConnection, object): ...@@ -556,7 +556,7 @@ class Connection(smac.SizedMessageAsyncConnection, object):
% (name, short_repr(args)), % (name, short_repr(args)),
level=logging.DEBUG) level=logging.DEBUG)
return return
msg = "Invalid method name: %s on %s" % (name, repr(obj)) msg = "Invalid method name: %s on %s" % (name, repr(obj))
raise ZRPCError(msg) raise ZRPCError(msg)
if __debug__: if __debug__:
...@@ -781,7 +781,7 @@ class Connection(smac.SizedMessageAsyncConnection, object): ...@@ -781,7 +781,7 @@ class Connection(smac.SizedMessageAsyncConnection, object):
self.trigger.pull_trigger() self.trigger.pull_trigger()
class ManagedServerConnection(Connection): class ManagedServerConnection(Connection):
"""Server-side Connection subclass.""" """Server-side Connection subclass."""
......
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