Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify command ACK #1370

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def _event_loop(self):
self.wait_for_children()

try:
_command = self._command_queue.get(timeout=1.0)
d_tag, props, body = _command
d_tag, props, body = self._command_queue.get(timeout=1.0)
self._command.ack(d_tag)
if props.headers and props.headers.get("debug", False):
body_log_b = _redact_url_creds(body, redact_user=False)
log.warning(
Expand Down Expand Up @@ -448,7 +448,6 @@ def _event_loop(self):
f"Unable to deserialize Globus Compute services command."
f" ({e.__class__.__name__}) {e}"
)
self._command.ack(d_tag)
continue

now = round(time.time())
Expand All @@ -461,15 +460,13 @@ def _event_loop(self):
f"\n Command timestamp: {server_cmd_ts:,} ({server_pp_ts})"
f"\n Endpoint timestamp: {now:,} ({endp_pp_ts})"
)
self._command.ack(d_tag)
continue

try:
effective_identity = msg["globus_effective_identity"]
identity_set = msg["globus_identity_set"]
except Exception as e:
log.error(f"Invalid server command. ({e.__class__.__name__}) {e}")
self._command.ack(d_tag)
continue

identity_for_log = (
Expand All @@ -485,13 +482,11 @@ def _event_loop(self):
"Identity failed to map to a local user name."
f" ({e.__class__.__name__}) {e}{identity_for_log}"
)
self._command.ack(d_tag)
continue
except Exception as e:
msg = "Unhandled error attempting to map user."
log.debug(f"{msg}{identity_for_log}", exc_info=e)
log.error(f"{msg} ({e.__class__.__name__}) {e}{identity_for_log}")
self._command.ack(d_tag)
continue

try:
Expand All @@ -503,7 +498,6 @@ def _event_loop(self):
" Identity mapped to a local user name, but local user does not"
f" exist.\n Local user name: {local_username}{identity_for_log}"
)
self._command.ack(d_tag)
continue

try:
Expand All @@ -528,8 +522,6 @@ def _event_loop(self):
f" args: {command_args}\n"
f" kwargs: {command_kwargs}{identity_for_log}"
)
finally:
self._command.ack(d_tag)

def cmd_start_endpoint(
self,
Expand Down
Loading