Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
neoppod
Commits
d112bfbd
Commit
d112bfbd
authored
Oct 10, 2023
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neoctl: do not wait forever if master disconnects
parent
57956ec9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
neo/neoctl/handler.py
neo/neoctl/handler.py
+4
-8
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+9
-0
No files found.
neo/neoctl/handler.py
View file @
d112bfbd
...
@@ -42,14 +42,10 @@ class CommandEventHandler(EventHandler):
...
@@ -42,14 +42,10 @@ class CommandEventHandler(EventHandler):
super
(
CommandEventHandler
,
self
).
connectionFailed
(
conn
)
super
(
CommandEventHandler
,
self
).
connectionFailed
(
conn
)
self
.
__disconnected
()
self
.
__disconnected
()
def
ack
(
self
,
conn
,
msg
):
def
error
(
self
,
conn
,
code
,
message
,
**
kw
):
self
.
__respond
((
Packets
.
Error
,
ErrorCodes
.
ACK
,
msg
))
if
code
==
ErrorCodes
.
DENIED
:
sys
.
exit
(
message
)
def
denied
(
self
,
conn
,
msg
):
self
.
__respond
((
Packets
.
Error
,
code
,
message
))
sys
.
exit
(
msg
)
def
notReady
(
self
,
conn
,
msg
):
self
.
__respond
((
Packets
.
Error
,
ErrorCodes
.
NOT_READY
,
msg
))
def
__answer
(
packet_type
):
def
__answer
(
packet_type
):
def
answer
(
self
,
conn
,
*
args
):
def
answer
(
self
,
conn
,
*
args
):
...
...
neo/tests/threaded/test.py
View file @
d112bfbd
...
@@ -2856,6 +2856,15 @@ class Test(NEOThreadedTest):
...
@@ -2856,6 +2856,15 @@ class Test(NEOThreadedTest):
self
.
assertRaises
(
SystemExit
,
cluster
.
neoctl
.
setClusterState
,
self
.
assertRaises
(
SystemExit
,
cluster
.
neoctl
.
setClusterState
,
ClusterStates
.
STARTING_BACKUP
)
ClusterStates
.
STARTING_BACKUP
)
@
with_cluster
()
def
testNeoctlVsDisconnectingMaster
(
self
,
cluster
):
def
setClusterState
(
orig
,
conn
,
*
args
):
conn
.
close
()
with
Patch
(
cluster
.
master
.
administration_handler
,
setClusterState
=
setClusterState
):
self
.
assertRaises
(
RuntimeError
,
cluster
.
neoctl
.
setClusterState
,
ClusterStates
.
STARTING_BACKUP
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
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