mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-09 21:17:47 +08:00
Reorder close queues before catch exceptions (avoids close in group runner loop)
This commit is contained in:
parent
4a51513469
commit
e62372653b
1 changed files with 20 additions and 23 deletions
|
@ -666,10 +666,7 @@ class NPBackupRunner:
|
||||||
f"Runner: Function {operation} failed with: {exc}", level="error"
|
f"Runner: Function {operation} failed with: {exc}", level="error"
|
||||||
)
|
)
|
||||||
logger.error("Trace:", exc_info=True)
|
logger.error("Trace:", exc_info=True)
|
||||||
if self.stdout:
|
|
||||||
self.stdout.put(None)
|
|
||||||
if self.stderr:
|
|
||||||
self.stderr.put(None)
|
|
||||||
# In case of error, we really need to write metrics
|
# In case of error, we really need to write metrics
|
||||||
# pylint: disable=E1101 (no-member)
|
# pylint: disable=E1101 (no-member)
|
||||||
metric_writer(self.repo_config, False, None, fn.__name__, self.dry_run)
|
metric_writer(self.repo_config, False, None, fn.__name__, self.dry_run)
|
||||||
|
@ -923,9 +920,9 @@ class NPBackupRunner:
|
||||||
# but @catch_exceptions should come last, since we aren't supposed to have errors in decorators
|
# but @catch_exceptions should come last, since we aren't supposed to have errors in decorators
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -938,9 +935,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.init()
|
return self.restic_runner.init()
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -954,9 +951,9 @@ class NPBackupRunner:
|
||||||
return snapshots
|
return snapshots
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -970,9 +967,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.list(subject)
|
return self.restic_runner.list(subject)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -987,9 +984,9 @@ class NPBackupRunner:
|
||||||
return self.convert_to_json_output(result, None)
|
return self.convert_to_json_output(result, None)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1004,8 +1001,8 @@ class NPBackupRunner:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
@catch_exceptions
|
|
||||||
@close_queues
|
@close_queues
|
||||||
|
@catch_exceptions
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1059,8 +1056,8 @@ class NPBackupRunner:
|
||||||
return result, backup_tz
|
return result, backup_tz
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
@catch_exceptions
|
|
||||||
@close_queues
|
@close_queues
|
||||||
|
@catch_exceptions
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1330,9 +1327,9 @@ class NPBackupRunner:
|
||||||
return self.convert_to_json_output(result, msg)
|
return self.convert_to_json_output(result, msg)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1347,9 +1344,9 @@ class NPBackupRunner:
|
||||||
)
|
)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1415,9 +1412,9 @@ class NPBackupRunner:
|
||||||
return self.convert_to_json_output(result)
|
return self.convert_to_json_output(result)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1452,9 +1449,9 @@ class NPBackupRunner:
|
||||||
return self.convert_to_json_output(result)
|
return self.convert_to_json_output(result)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1474,9 +1471,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.check(read_data)
|
return self.restic_runner.check(read_data)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1497,9 +1494,9 @@ class NPBackupRunner:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1512,9 +1509,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.repair(subject, pack_ids)
|
return self.restic_runner.repair(subject, pack_ids)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1527,9 +1524,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.recover()
|
return self.restic_runner.recover()
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1540,9 +1537,9 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.unlock()
|
return self.restic_runner.unlock()
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1556,9 +1553,9 @@ class NPBackupRunner:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1572,9 +1569,9 @@ class NPBackupRunner:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
|
@close_queues
|
||||||
@catch_exceptions
|
@catch_exceptions
|
||||||
@metrics
|
@metrics
|
||||||
@close_queues
|
|
||||||
@exec_timer
|
@exec_timer
|
||||||
@check_concurrency
|
@check_concurrency
|
||||||
@has_permission
|
@has_permission
|
||||||
|
@ -1585,8 +1582,8 @@ class NPBackupRunner:
|
||||||
return self.restic_runner.raw(command=command)
|
return self.restic_runner.raw(command=command)
|
||||||
|
|
||||||
@threaded
|
@threaded
|
||||||
@catch_exceptions
|
|
||||||
@close_queues
|
@close_queues
|
||||||
|
@catch_exceptions
|
||||||
@exec_timer
|
@exec_timer
|
||||||
def group_runner(self, repo_config_list: List, operation: str, **kwargs) -> bool:
|
def group_runner(self, repo_config_list: List, operation: str, **kwargs) -> bool:
|
||||||
group_result = True
|
group_result = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue