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
40e5f996
Commit
40e5f996
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 trunk
parent
ade87e13
Changes
5
Hide 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 @
40e5f996
...
...
@@ -100,6 +100,9 @@ Restructuring
Features Added
++++++++++++++
- LP #143013: make the maximum number of retries on ConflictError a
configuration option.
- LP #142502: Added a knob to the Debug control panel for resetting
profile data. Thanks to Vladimir Patukhov for the patch.
...
...
src/Zope2/Startup/handlers.py
View file @
40e5f996
...
...
@@ -188,12 +188,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 @
40e5f996
...
...
@@ -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 @
40e5f996
...
...
@@ -661,6 +661,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 @
40e5f996
...
...
@@ -808,6 +808,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