Skip to content
Snippets Groups Projects
Commit 03052b83 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

More logging

parent c1c6b7ff
No related branches found
No related tags found
1 merge request!441Refactor 'webservice' ZMQ server
...@@ -389,6 +389,7 @@ async def update_job_db(config): ...@@ -389,6 +389,7 @@ async def update_job_db(config):
'calcat_feedback': msg}} 'calcat_feedback': msg}}
response = mdc.update_dark_run_api(rid, data) response = mdc.update_dark_run_api(rid, data)
if response.status_code != 200: if response.status_code != 200:
logging.error("Failed to update MDC for action %s, rid %s", action, rid)
logging.error(Errors.MDC_RESPONSE.format(response)) logging.error(Errors.MDC_RESPONSE.format(response))
except Exception as e: except Exception as e:
e = str(e) e = str(e)
...@@ -519,6 +520,8 @@ async def wait_transfers(wait_runs: List[str], in_folder: str, proposal: str): ...@@ -519,6 +520,8 @@ async def wait_transfers(wait_runs: List[str], in_folder: str, proposal: str):
""" """
all_transfers = [] all_transfers = []
logging.debug("Waiting for: propsal %s, runs %s", proposal, wait_runs)
# FIXME: this loop should be an asyncio.gather # FIXME: this loop should be an asyncio.gather
for runnr in wait_runs: for runnr in wait_runs:
rpath = "{}/r{:04d}/".format(in_folder, int(runnr)) rpath = "{}/r{:04d}/".format(in_folder, int(runnr))
...@@ -675,6 +678,7 @@ class ActionsServer: ...@@ -675,6 +678,7 @@ class ActionsServer:
logging.error("Unexpected error handling request", exc_info=e) logging.error("Unexpected error handling request", exc_info=e)
resp = Errors.OTHER_ERROR.format(e).encode() resp = Errors.OTHER_ERROR.format(e).encode()
logging.debug("Sending response: %r", resp)
await self.socket.send(resp) await self.socket.send(resp)
async def handle_one_req(self, req: List[bytes]) -> bytes: async def handle_one_req(self, req: List[bytes]) -> bytes:
...@@ -695,6 +699,7 @@ class ActionsServer: ...@@ -695,6 +699,7 @@ class ActionsServer:
logging.warning(Errors.UNKNOWN_ACTION.format(action)) logging.warning(Errors.UNKNOWN_ACTION.format(action))
return Errors.UNKNOWN_ACTION.format(action).encode() return Errors.UNKNOWN_ACTION.format(action).encode()
logging.info("Handling request for action %s", action)
logging.debug('Running action %s, payload %r', action, payload) logging.debug('Running action %s, payload %r', action, payload)
handler = getattr(self, 'handle_' + action.replace('-', '_')) handler = getattr(self, 'handle_' + action.replace('-', '_'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment