Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
786a742b
Commit
786a742b
authored
Jul 25, 2013
by
Mukund Sivaraman
Browse files
[2856] With no readers, make complete_update() from UPDATING go directly to READY
parent
4f96d3ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/python/isc/memmgr/datasrc_info.py
View file @
786a742b
...
...
@@ -169,7 +169,7 @@ class SegmentInfo:
self
.
__state
=
self
.
SYNCHRONIZING
self
.
__old_readers
=
self
.
__readers
self
.
__readers
=
set
()
return
self
.
__sync_reader_helper
(
self
.
SYNCHRONIZING
)
return
self
.
__sync_reader_helper
(
self
.
READY
)
elif
self
.
__state
==
self
.
COPYING
:
self
.
__state
=
self
.
READY
return
None
...
...
src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
View file @
786a742b
...
...
@@ -175,6 +175,18 @@ class TestSegmentInfo(unittest.TestCase):
self
.
assertIsNone
(
e
)
# old_readers is not empty
self
.
assertEqual
(
self
.
__sgmt_info
.
get_state
(),
SegmentInfo
.
SYNCHRONIZING
)
# c) with no readers, complete_update() from UPDATING must go
# directly to READY state
self
.
__si_to_ready_state
()
self
.
__sgmt_info
.
add_event
((
42
,))
e
=
self
.
__sgmt_info
.
start_update
()
self
.
assertTupleEqual
(
e
,
(
42
,))
self
.
assertSetEqual
(
self
.
__sgmt_info
.
get_readers
(),
set
())
self
.
assertEqual
(
self
.
__sgmt_info
.
get_state
(),
SegmentInfo
.
UPDATING
)
e
=
self
.
__sgmt_info
.
complete_update
()
self
.
assertTupleEqual
(
e
,
(
42
,))
self
.
assertEqual
(
self
.
__sgmt_info
.
get_state
(),
SegmentInfo
.
READY
)
# in SYNCHRONIZING state
self
.
__si_to_synchronizing_state
()
self
.
assertRaises
(
SegmentInfoError
,
self
.
__sgmt_info
.
complete_update
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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