Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
67b1d475
Commit
67b1d475
authored
Apr 17, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the maximum number of retries on ConflictError a configuration option.
fixes lp:143013 on this branch
parent
4d2db1b8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/Zope2/Startup/handlers.py
src/Zope2/Startup/handlers.py
+7
-2
src/Zope2/Startup/tests/test_schema.py
src/Zope2/Startup/tests/test_schema.py
+13
-0
src/Zope2/Startup/zopeschema.xml
src/Zope2/Startup/zopeschema.xml
+6
-0
src/Zope2/utilities/skel/etc/zope.conf.in
src/Zope2/utilities/skel/etc/zope.conf.in
+12
-0
No files found.
doc/CHANGES.rst
View file @
67b1d475
...
...
@@ -15,6 +15,9 @@ Features Added
- zope.i18nmessageid = 3.5.1
- LP #143013: make the maximum number of retries on ConflictError a
configuration option.
Bugs Fixed
++++++++++
...
...
src/Zope2/Startup/handlers.py
View file @
67b1d475
...
...
@@ -207,12 +207,17 @@ def root_handler(config):
# set up trusted proxies
if
config
.
trusted_proxies
:
import
ZPublisher.
HTTPRequest
from
ZPublisher
import
HTTPRequest
# DM 2004-11-24: added host name mapping (such that examples in
# conf file really have a chance to work
mapped
=
[]
for
name
in
config
.
trusted_proxies
:
mapped
.
extend
(
_name2Ips
(
name
))
ZPublisher
.
HTTPRequest
.
trusted_proxies
=
tuple
(
mapped
)
HTTPRequest
.
trusted_proxies
=
tuple
(
mapped
)
# set the maximum number of ConflictError retries
if
config
.
max_conflict_retries
:
from
ZPublisher
import
HTTPRequest
HTTPRequest
.
retry_max_count
=
config
.
max_conflict_retries
def
handleConfig
(
config
,
multihandler
):
...
...
src/Zope2/Startup/tests/test_schema.py
View file @
67b1d475
...
...
@@ -208,6 +208,19 @@ class StartupTestCase(unittest.TestCase):
self
.
assertEqual
(
conf
.
databases
[
0
].
config
.
connection_class
.
__name__
,
'LowConflictConnection'
)
def
test_max_conflict_retries_default
(
self
):
conf
,
handler
=
self
.
load_config_text
(
"""
\
instancehome <<INSTANCE_HOME>>
"""
)
self
.
assertEqual
(
conf
.
max_conflict_retries
,
3
)
def
test_max_conflict_retries_explicit
(
self
):
conf
,
handler
=
self
.
load_config_text
(
"""
\
instancehome <<INSTANCE_HOME>>
max-conflict-retries 15
"""
)
self
.
assertEqual
(
conf
.
max_conflict_retries
,
15
)
def
test_suite
():
return
unittest
.
makeSuite
(
StartupTestCase
)
...
...
src/Zope2/Startup/zopeschema.xml
View file @
67b1d475
...
...
@@ -653,6 +653,12 @@
<metadefault>
unset
</metadefault>
</multikey>
<key
name=
"max-conflict-retries"
datatype=
"integer"
default=
"3"
attribute=
"max_conflict_retries"
>
<description>
The maximum number of retries on a conflict error
</description>
</key>
<key
name=
"security-policy-implementation"
datatype=
".security_policy_implementation"
default=
"C"
>
...
...
src/Zope2/utilities/skel/etc/zope.conf.in
View file @
67b1d475
...
...
@@ -826,6 +826,18 @@ instancehome $INSTANCE
#
# conflict-error-log-level blather
# Directive: max-conflict-retries
#
# Description:
# Specifies how many times a transaction will be re-tried when
# it generates ConflictErrors. This can be a problem when using
# a ZEO server and you have large numbers of simultaneous writes.
#
# Default: 3
#
# Example:
#
# max-conflict-retries 10
# Directive: warnfilter
#
...
...
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