Skip to content

Commit

Permalink
Save status to original_status when moving to quarantine (#267)
Browse files Browse the repository at this point in the history
* Save status to original_status when moving to quarantine
  • Loading branch information
blinkdog authored Sep 7, 2023
1 parent 52e86ff commit 126867e
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 107 deletions.
1 change: 1 addition & 0 deletions lta/bundler.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/deleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/desy_move_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/desy_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ async def _do_work_claim(self) -> bool:
bundle_id = bundle["uuid"]
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/gridftp_replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ async def _quarantine_transfer_request(self,
self.logger.error(f'Sending TransferRequest {tr["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": tr["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/nersc_mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async def _do_work_claim(self) -> bool:
bundle_id = bundle["uuid"]
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/nersc_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ async def _execute_hsi_command(self, lta_rc: RestClient, bundle: BundleType, arg
bundle_id = bundle["uuid"]
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:hsi Command Failed - {completed_process.args} - {completed_process.returncode} - {str(completed_process.stdout)} - {str(completed_process.stderr)}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/nersc_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async def _do_work_claim(self) -> bool:
bundle_uuid = bundle["uuid"]
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ async def _quarantine_transfer_request(self,
self.logger.error(f'Sending TransferRequest {tr["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": tr["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/rate_limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/site_move_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
1 change: 1 addition & 0 deletions lta/unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ async def _quarantine_bundle(self,
self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.')
right_now = now()
patch_body = {
"original_status": bundle["status"],
"status": "quarantined",
"reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}",
"work_priority_timestamp": right_now,
Expand Down
86 changes: 45 additions & 41 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
# pip-compile --extra=dev --output-file=requirements-dev.txt
#
backoff==2.2.1
# via opentelemetry-exporter-otlp-proto-http
# via
# opentelemetry-exporter-otlp-proto-common
# opentelemetry-exporter-otlp-proto-http
binpacking==1.5.2
# via lta (setup.py)
cachetools==5.3.1
# via wipac-rest-tools
certifi==2023.5.7
certifi==2023.7.22
# via requests
cffi==1.15.1
# via cryptography
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
click==8.1.3
click==8.1.7
# via
# click-completion
# pycycle
Expand All @@ -28,37 +30,37 @@ colorama==0.4.6
# lta (setup.py)
coloredlogs==15.0.1
# via wipac-telemetry
coverage[toml]==7.2.7
coverage[toml]==7.3.1
# via pytest-cov
crayons==0.4.0
# via pycycle
cryptography==41.0.1
cryptography==41.0.3
# via pyjwt
deprecated==1.2.14
# via
# opentelemetry-api
# opentelemetry-exporter-otlp-proto-http
dnspython==2.3.0
dnspython==2.4.2
# via pymongo
exceptiongroup==1.1.1
exceptiongroup==1.1.3
# via pytest
flake8==6.0.0
flake8==6.1.0
# via lta (setup.py)
future==0.18.3
# via binpacking
googleapis-common-protos==1.56.2
# via
# opentelemetry-exporter-jaeger-proto-grpc
# opentelemetry-exporter-otlp-proto-http
grpcio==1.54.2
grpcio==1.57.0
# via opentelemetry-exporter-jaeger-proto-grpc
humanfriendly==10.0
# via coloredlogs
hurry-filesize==0.9
# via lta (setup.py)
idna==3.4
# via requests
importlib-metadata==6.0.1
importlib-metadata==6.8.0
# via opentelemetry-api
iniconfig==2.0.0
# via pytest
Expand All @@ -68,80 +70,80 @@ markupsafe==2.1.3
# via jinja2
mccabe==0.7.0
# via flake8
motor==3.1.2
motor==3.3.1
# via lta (setup.py)
mypy==1.3.0
mypy==1.5.1
# via lta (setup.py)
mypy-extensions==1.0.0
# via mypy
opentelemetry-api==1.18.0
opentelemetry-api==1.20.0
# via
# opentelemetry-exporter-jaeger-proto-grpc
# opentelemetry-exporter-jaeger-thrift
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-sdk
# wipac-telemetry
opentelemetry-exporter-jaeger==1.18.0
opentelemetry-exporter-jaeger==1.20.0
# via wipac-telemetry
opentelemetry-exporter-jaeger-proto-grpc==1.18.0
opentelemetry-exporter-jaeger-proto-grpc==1.20.0
# via opentelemetry-exporter-jaeger
opentelemetry-exporter-jaeger-thrift==1.18.0
opentelemetry-exporter-jaeger-thrift==1.20.0
# via opentelemetry-exporter-jaeger
opentelemetry-exporter-otlp-proto-common==1.18.0
opentelemetry-exporter-otlp-proto-common==1.20.0
# via opentelemetry-exporter-otlp-proto-http
opentelemetry-exporter-otlp-proto-http==1.18.0
opentelemetry-exporter-otlp-proto-http==1.20.0
# via wipac-telemetry
opentelemetry-proto==1.18.0
opentelemetry-proto==1.20.0
# via
# opentelemetry-exporter-otlp-proto-common
# opentelemetry-exporter-otlp-proto-http
opentelemetry-sdk==1.18.0
opentelemetry-sdk==1.20.0
# via
# opentelemetry-exporter-jaeger-proto-grpc
# opentelemetry-exporter-jaeger-thrift
# opentelemetry-exporter-otlp-proto-http
# wipac-telemetry
opentelemetry-semantic-conventions==0.39b0
opentelemetry-semantic-conventions==0.41b0
# via opentelemetry-sdk
packaging==23.1
# via pytest
pluggy==1.0.0
pluggy==1.3.0
# via pytest
prometheus-client==0.17.0
prometheus-client==0.17.1
# via lta (setup.py)
protobuf==3.20.3
# via
# googleapis-common-protos
# opentelemetry-proto
# wipac-telemetry
pycodestyle==2.10.0
pycodestyle==2.11.0
# via flake8
pycparser==2.21
# via cffi
pycycle==0.0.8
# via lta (setup.py)
pyflakes==3.0.1
pyflakes==3.1.0
# via flake8
pyjwt[crypto]==2.7.0
pyjwt[crypto]==2.8.0
# via wipac-rest-tools
pymongo==4.3.3
pymongo==4.5.0
# via
# lta (setup.py)
# motor
pypng==0.20220715.0
# via qrcode
pytest==7.3.2
pytest==7.4.1
# via
# lta (setup.py)
# pycycle
# pytest-asyncio
# pytest-cov
# pytest-mock
pytest-asyncio==0.21.0
pytest-asyncio==0.21.1
# via lta (setup.py)
pytest-cov==4.1.0
# via lta (setup.py)
pytest-mock==3.10.0
pytest-mock==3.11.1
# via lta (setup.py)
qrcode==7.4.2
# via wipac-rest-tools
Expand All @@ -152,9 +154,9 @@ requests==2.31.0
# requests-futures
# wipac-dev-tools
# wipac-rest-tools
requests-futures==1.0.0
requests-futures==1.0.1
# via wipac-rest-tools
shellingham==1.5.0.post1
shellingham==1.5.3
# via click-completion
six==1.16.0
# via
Expand All @@ -167,35 +169,37 @@ tomli==2.0.1
# coverage
# mypy
# pytest
tornado==6.3.2
tornado==6.3.3
# via
# lta (setup.py)
# wipac-rest-tools
types-requests==2.31.0.1
types-requests==2.31.0.2
# via lta (setup.py)
types-urllib3==1.26.25.13
types-urllib3==1.26.25.14
# via types-requests
typing-extensions==4.6.3
typing-extensions==4.7.1
# via
# mypy
# opentelemetry-sdk
# qrcode
# wipac-dev-tools
# wipac-telemetry
urllib3==2.0.3
# via requests
urllib3==2.0.4
# via
# requests
# wipac-rest-tools
wipac-dev-tools==1.6.16
# via
# lta (setup.py)
# wipac-rest-tools
# wipac-telemetry
wipac-rest-tools==1.4.20
wipac-rest-tools==1.5.3
# via lta (setup.py)
wipac-telemetry==0.2.7
# via lta (setup.py)
wrapt==1.15.0
# via deprecated
zipp==3.15.0
zipp==3.16.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
Loading

0 comments on commit 126867e

Please sign in to comment.