Merge branch 'log-oom-error' into 'v3'
Custom sigkill error See merge request openflexure/openflexure-microscope-server!351
This commit is contained in:
commit
99652eca41
1 changed files with 12 additions and 1 deletions
|
|
@ -26,6 +26,10 @@ DEFAULT_OVERLAP = 0.1
|
|||
DEFAULT_RESIZE = 0.5
|
||||
|
||||
|
||||
class ExternalSigkillError(ChildProcessError):
|
||||
"""Exception called when stitch is killed by an external process calling Sigkill."""
|
||||
|
||||
|
||||
class StitcherValidationError(RuntimeError):
|
||||
"""The stitcher received values that it deems unsafe to create a command from."""
|
||||
|
||||
|
|
@ -303,8 +307,15 @@ class FinalStitcher(BaseStitcher):
|
|||
|
||||
if process.poll() == 0:
|
||||
self.logger.info("Stitching complete")
|
||||
elif process.poll() == -9:
|
||||
raise ExternalSigkillError(
|
||||
"Stitching was killed by an external process. This is "
|
||||
"most likely due to running out of memory."
|
||||
)
|
||||
else:
|
||||
raise ChildProcessError(f"Subprocess {STITCHING_CMD} exited with an error.")
|
||||
raise ChildProcessError(
|
||||
f"Subprocess {STITCHING_CMD} errored with exit code {process.poll()}."
|
||||
)
|
||||
|
||||
def _log_ongoing(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue