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
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
Hide 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):
...
@@ -26,10 +26,11 @@ class SecondaryMasterHandler(MasterHandler):
""" Handler used by primary to handle secondary masters"""
""" Handler used by primary to handle secondary masters"""
def
connectionLost
(
self
,
conn
,
new_state
):
def
connectionLost
(
self
,
conn
,
new_state
):
node
=
self
.
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
app
=
self
.
app
assert
node
is
not
None
if
app
.
listening_conn
:
# if running
node
.
setDown
()
node
=
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
self
.
app
.
broadcastNodesInformation
([
node
])
node
.
setDown
()
app
.
broadcastNodesInformation
([
node
])
def
announcePrimary
(
self
,
conn
):
def
announcePrimary
(
self
,
conn
):
raise
ElectionFailure
,
'another primary arises'
raise
ElectionFailure
,
'another primary arises'
...
@@ -45,12 +46,12 @@ class PrimaryHandler(EventHandler):
...
@@ -45,12 +46,12 @@ class PrimaryHandler(EventHandler):
""" Handler used by secondaries to handle primary master"""
""" Handler used by secondaries to handle primary master"""
def
connectionLost
(
self
,
conn
,
new_state
):
def
connectionLost
(
self
,
conn
,
new_state
):
self
.
app
.
primary_master_node
.
setDown
()
self
.
connectionFailed
(
conn
)
raise
PrimaryFailure
,
'primary master is dead'
def
connectionFailed
(
self
,
conn
):
def
connectionFailed
(
self
,
conn
):
self
.
app
.
primary_master_node
.
setDown
()
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
):
def
connectionCompleted
(
self
,
conn
):
app
=
self
.
app
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