Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
92392f62
Commit
92392f62
authored
Jan 23, 2025
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid/slapgrid: reduce cases when slapgrid switch to offline mode
parent
e90ff84e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+17
-5
No files found.
slapos/grid/slapgrid.py
View file @
92392f62
...
@@ -335,6 +335,12 @@ def check_required_only_partitions(existing, required):
...
@@ -335,6 +335,12 @@ def check_required_only_partitions(existing, required):
return
required
return
required
class
SlapgridException
(
Exception
):
pass
class
NotConnectedToSlapOSMaster
(
SlapgridException
):
pass
class
Slapgrid
(
object
):
class
Slapgrid
(
object
):
""" Main class for SlapGrid. Fetches and processes informations from master
""" Main class for SlapGrid. Fetches and processes informations from master
server and pushes usage information to master server.
server and pushes usage information to master server.
...
@@ -1422,12 +1428,10 @@ stderr_logfile_backups=1
...
@@ -1422,12 +1428,10 @@ stderr_logfile_backups=1
def
processComputerPartitionList
(
self
):
def
processComputerPartitionList
(
self
):
try
:
try
:
return
self
.
processComputerPartitionListOnline
()
return
self
.
processComputerPartitionListOnline
()
except
(
RequestException
,
ConnectionError
):
except
NotConnectedToSlapOSMaster
:
# XXX Romain Why catching all errors?
# We should only check getting global state of comp
# We should only check getting global state of comp
# and going offline in this case
# and going offline in this case
raise
return
self
.
processComputerPartitionListOffline
()
# return self.processComputerPartitionListOffline()
def
processComputerPartitionListOnline
(
self
):
def
processComputerPartitionListOnline
(
self
):
"""
"""
...
@@ -1443,7 +1447,15 @@ stderr_logfile_backups=1
...
@@ -1443,7 +1447,15 @@ stderr_logfile_backups=1
# Boolean to know if every promises correctly passed
# Boolean to know if every promises correctly passed
clean_run_promise
=
True
clean_run_promise
=
True
try
:
computer_partition_list
=
self
.
getRequiredComputerPartitionList
()
computer_partition_list
=
self
.
getRequiredComputerPartitionList
()
except
(
RequestException
,
ConnectionError
)
as
exc
:
# If connection to the slapos master fails
# while retrieving compute node state,
# switch to the offline mode
# Log the exception to understand why it switched to offline mode
self
.
logger
.
error
(
exc
)
raise
NotConnectedToSlapOSMaster
process_error_partition_list
=
[]
process_error_partition_list
=
[]
promise_error_partition_list
=
[]
promise_error_partition_list
=
[]
...
...
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