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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
d825f158
Commit
d825f158
authored
Jul 19, 2016
by
Jim Fulton
Committed by
GitHub
Jul 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #52 from zopefoundation/rehabilitate-mtacceptor
Rehabilitate mtacceptor
parents
a9330b7e
b971495a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
16 deletions
+31
-16
.travis.yml
.travis.yml
+6
-0
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+5
-1
src/ZEO/asyncio/mtacceptor.py
src/ZEO/asyncio/mtacceptor.py
+20
-15
No files found.
.travis.yml
View file @
d825f158
...
@@ -8,6 +8,12 @@ matrix:
...
@@ -8,6 +8,12 @@ matrix:
python
:
3.4
python
:
3.4
-
os
:
linux
-
os
:
linux
python
:
3.5
python
:
3.5
-
os
:
linux
python
:
3.4
env
:
ZEO_MTACCEPTOR=1
-
os
:
linux
python
:
3.5
env
:
ZEO_MTACCEPTOR=1
install
:
install
:
-
pip install -U setuptools
-
pip install -U setuptools
-
python bootstrap.py
-
python bootstrap.py
...
...
src/ZEO/StorageServer.py
View file @
d825f158
...
@@ -49,7 +49,10 @@ from ZODB.POSException import TransactionError, ReadOnlyError, ConflictError
...
@@ -49,7 +49,10 @@ from ZODB.POSException import TransactionError, ReadOnlyError, ConflictError
from
ZODB.serialize
import
referencesf
from
ZODB.serialize
import
referencesf
from
ZODB.utils
import
oid_repr
,
p64
,
u64
,
z64
,
Lock
,
RLock
from
ZODB.utils
import
oid_repr
,
p64
,
u64
,
z64
,
Lock
,
RLock
from
.asyncio.server
import
Acceptor
if
os
.
environ
.
get
(
"ZEO_MTACCEPTOR"
):
# mainly for tests
from
.asyncio.mtacceptor
import
Acceptor
else
:
from
.asyncio.server
import
Acceptor
logger
=
logging
.
getLogger
(
'ZEO.StorageServer'
)
logger
=
logging
.
getLogger
(
'ZEO.StorageServer'
)
...
@@ -655,6 +658,7 @@ class StorageServer:
...
@@ -655,6 +658,7 @@ class StorageServer:
transaction_timeout
=
None
,
transaction_timeout
=
None
,
ssl
=
None
,
ssl
=
None
,
client_conflict_resolution
=
False
,
client_conflict_resolution
=
False
,
Acceptor
=
Acceptor
,
):
):
"""StorageServer constructor.
"""StorageServer constructor.
...
...
src/ZEO/asyncio/mtacceptor.py
View file @
d825f158
...
@@ -51,6 +51,7 @@ else:
...
@@ -51,6 +51,7 @@ else:
import
asyncore
import
asyncore
import
socket
import
socket
import
threading
import
threading
import
time
from
.server
import
ServerProtocol
from
.server
import
ServerProtocol
...
@@ -130,7 +131,7 @@ class Acceptor(asyncore.dispatcher):
...
@@ -130,7 +131,7 @@ class Acceptor(asyncore.dispatcher):
break
break
if
isinstance
(
addr
,
tuple
)
and
addr
[
1
]
==
0
:
if
isinstance
(
addr
,
tuple
)
and
addr
[
1
]
==
0
:
self
.
addr
=
addr
=
self
.
socket
.
getsockname
()
self
.
addr
=
addr
=
self
.
socket
.
getsockname
()
[:
2
]
logger
.
info
(
"listening on %s"
,
str
(
addr
))
logger
.
info
(
"listening on %s"
,
str
(
addr
))
self
.
listen
(
5
)
self
.
listen
(
5
)
...
@@ -176,6 +177,10 @@ class Acceptor(asyncore.dispatcher):
...
@@ -176,6 +177,10 @@ class Acceptor(asyncore.dispatcher):
if
self
.
ssl_context
is
None
:
if
self
.
ssl_context
is
None
:
cr
=
loop
.
create_connection
((
lambda
:
protocol
),
sock
=
sock
)
cr
=
loop
.
create_connection
((
lambda
:
protocol
),
sock
=
sock
)
else
:
if
hasattr
(
loop
,
'connect_accepted_socket'
):
loop
.
connect_accepted_socket
(
(
lambda
:
protocol
),
sock
,
ssl
=
self
.
ssl_context
)
else
:
else
:
#######################################################
#######################################################
# XXX See http://bugs.python.org/issue27392 :(
# XXX See http://bugs.python.org/issue27392 :(
...
@@ -189,7 +194,7 @@ class Acceptor(asyncore.dispatcher):
...
@@ -189,7 +194,7 @@ class Acceptor(asyncore.dispatcher):
cr
=
loop
.
create_connection
(
cr
=
loop
.
create_connection
(
(
lambda
:
protocol
),
sock
=
sock
,
(
lambda
:
protocol
),
sock
=
sock
,
ssl
=
self
.
ssl_context
,
ssl
=
self
.
ssl_context
,
server_hostname
=
'fu'
# http://bugs.python.org/issue27391
server_hostname
=
''
)
)
asyncio
.
async
(
cr
,
loop
=
loop
)
asyncio
.
async
(
cr
,
loop
=
loop
)
...
...
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