Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Stefane Fermigier
neo
Commits
35737c9b
Commit
35737c9b
authored
Mar 20, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: fix random crashes on shutdown when using several master nodes
parent
35468667
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
neo/master/handlers/secondary.py
neo/master/handlers/secondary.py
+8
-7
No files found.
neo/master/handlers/secondary.py
View file @
35737c9b
...
...
@@ -26,10 +26,11 @@ class SecondaryMasterHandler(MasterHandler):
""" Handler used by primary to handle secondary masters"""
def
connectionLost
(
self
,
conn
,
new_state
):
node
=
self
.
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
assert
node
is
not
None
app
=
self
.
app
if
app
.
listening_conn
:
# if running
node
=
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
node
.
setDown
()
self
.
app
.
broadcastNodesInformation
([
node
])
app
.
broadcastNodesInformation
([
node
])
def
announcePrimary
(
self
,
conn
):
raise
ElectionFailure
,
'another primary arises'
...
...
@@ -45,12 +46,12 @@ class PrimaryHandler(EventHandler):
""" Handler used by secondaries to handle primary master"""
def
connectionLost
(
self
,
conn
,
new_state
):
self
.
app
.
primary_master_node
.
setDown
()
raise
PrimaryFailure
,
'primary master is dead'
self
.
connectionFailed
(
conn
)
def
connectionFailed
(
self
,
conn
):
self
.
app
.
primary_master_node
.
setDown
()
raise
PrimaryFailure
,
'primary master is dead'
if
self
.
app
.
listening_conn
:
# if running
raise
PrimaryFailure
(
'primary master is dead'
)
def
connectionCompleted
(
self
,
conn
):
app
=
self
.
app
...
...
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