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
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
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
Hide 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):
super
(
CommandEventHandler
,
self
).
connectionFailed
(
conn
)
self
.
__disconnected
()
def
ack
(
self
,
conn
,
msg
):
self
.
__respond
((
Packets
.
Error
,
ErrorCodes
.
ACK
,
msg
))
def
denied
(
self
,
conn
,
msg
):
sys
.
exit
(
msg
)
def
notReady
(
self
,
conn
,
msg
):
self
.
__respond
((
Packets
.
Error
,
ErrorCodes
.
NOT_READY
,
msg
))
def
error
(
self
,
conn
,
code
,
message
,
**
kw
):
if
code
==
ErrorCodes
.
DENIED
:
sys
.
exit
(
message
)
self
.
__respond
((
Packets
.
Error
,
code
,
message
))
def
__answer
(
packet_type
):
def
answer
(
self
,
conn
,
*
args
):
...
...
neo/tests/threaded/test.py
View file @
d112bfbd
...
...
@@ -2856,6 +2856,15 @@ class Test(NEOThreadedTest):
self
.
assertRaises
(
SystemExit
,
cluster
.
neoctl
.
setClusterState
,
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__"
:
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