Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
0998fa33
Commit
0998fa33
authored
Aug 29, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call notifyDisconnected() on the object handled by a Connection.
parent
e80d0649
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+8
-9
src/ZEO/zrpc/connection.py
src/ZEO/zrpc/connection.py
+2
-1
No files found.
src/ZEO/StorageServer.py
View file @
0998fa33
...
...
@@ -116,20 +116,19 @@ class ZEOStorage:
self
.
__storage_id
=
"uninitialized"
self
.
_transaction
=
None
def
close
(
self
):
def
notifyConnected
(
self
,
conn
):
self
.
_conn
=
conn
self
.
client
=
ClientStub
.
ClientStorage
(
conn
)
def
notifyDisconnected
(
self
):
# When this storage closes, we must ensure that it aborts
# any pending transaction. Not sure if this is the clearest way.
if
self
.
_transaction
is
not
None
:
self
.
_log
(
"
close
during transaction %s"
%
self
.
_transaction
,
self
.
_log
(
"
disconnected
during transaction %s"
%
self
.
_transaction
,
zLOG
.
BLATHER
)
self
.
tpc_abort
(
self
.
_transaction
.
id
)
else
:
self
.
_log
(
"close"
,
zLOG
.
BLATHER
)
self
.
_conn
.
close
()
def
notifyConnected
(
self
,
conn
):
self
.
_conn
=
conn
self
.
client
=
ClientStub
.
ClientStorage
(
conn
)
self
.
_log
(
"disconnected"
,
zLOG
.
BLATHER
)
def
__repr__
(
self
):
tid
=
self
.
_transaction
and
repr
(
self
.
_transaction
.
id
)
...
...
@@ -392,7 +391,7 @@ class ZEOStorage:
except
:
self
.
_log
(
"Unexpected error handling waiting transaction"
,
level
=
zLOG
.
WARNING
,
error
=
sys
.
exc_info
())
zeo_storage
.
close
()
zeo_storage
.
_conn
.
close
()
return
0
else
:
return
1
...
...
src/ZEO/zrpc/connection.py
View file @
0998fa33
...
...
@@ -389,9 +389,10 @@ class ManagedServerConnection(ServerConnection):
def
__init__
(
self
,
sock
,
addr
,
obj
,
mgr
):
self
.
__mgr
=
mgr
self
.
__super_init
(
sock
,
addr
,
obj
)
obj
.
notifyConnected
(
self
)
self
.
obj
.
notifyConnected
(
self
)
def
close
(
self
):
self
.
obj
.
notifyDisconnected
()
self
.
__super_close
()
self
.
__mgr
.
close
(
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment