diff --git a/cadence/activity_loop.py b/cadence/activity_loop.py index b0cdcce..12c8991 100644 --- a/cadence/activity_loop.py +++ b/cadence/activity_loop.py @@ -38,7 +38,8 @@ def activity_task_loop(worker: Worker): return except Exception as ex: logger.error("PollForActivityTask error: %s", ex) - continue + logger.error(f"Exiting") + break if err: logger.error("PollForActivityTask failed: %s", err) continue diff --git a/cadence/connection.py b/cadence/connection.py index 973e89c..f6253d2 100644 --- a/cadence/connection.py +++ b/cadence/connection.py @@ -356,4 +356,4 @@ def call_function(self, call: ThriftFunctionCall) -> ThriftFunctionResponse: raise Exception("Unexpected type: " + Frame.TYPE) assert isinstance(frame, FrameWithArgs) response.process_frame(frame) - return response + return response \ No newline at end of file diff --git a/cadence/ioutils.py b/cadence/ioutils.py index a96eb2f..458f164 100644 --- a/cadence/ioutils.py +++ b/cadence/ioutils.py @@ -1,8 +1,10 @@ from select import select from socket import socket from typing import IO, Callable +import logging +logger = logging.getLogger(__name__) class IOWrapper: def __init__(self, io_stream: IO, socket_: socket = None): self.io_stream = io_stream @@ -27,6 +29,9 @@ def read_or_eof(self, size, field): self.socket.settimeout(timeout) buf: bytes = self.io_stream.read(size) if len(buf) != size: + logger.info(f"buffer content bytes: {buf}") + logger.info(f"buffer size: {len(buf)}") + logger.info(f"size: {size}") raise EOFError(field) return buf diff --git a/cadence/workflow.py b/cadence/workflow.py index be570a8..1885935 100644 --- a/cadence/workflow.py +++ b/cadence/workflow.py @@ -208,7 +208,7 @@ def exec_workflow(workflow_client, wm: WorkflowMethod, args, workflow_options: W start_request = create_start_workflow_request(workflow_client, wm, args) start_response, err = workflow_client.service.start_workflow(start_request) if err: - raise Exception(err) + raise Exception(repr(err)) execution = WorkflowExecution(workflow_id=start_request.workflow_id, run_id=start_response.run_id) stub_instance._execution = execution return WorkflowExecutionContext(workflow_type=wm._name, workflow_execution=execution)