Skip to content

Commit 05a1f65

Browse files
committed
chore: remove unused invoke timeout
1 parent d238353 commit 05a1f65

5 files changed

Lines changed: 13 additions & 25 deletions

File tree

src/aws_durable_execution_sdk_python/config.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,9 @@ class InvokeConfig(Generic[P, R]):
384384
Configuration for invoke operations.
385385
386386
This class configures how function invocations are executed, including
387-
timeout behavior, serialization, and tenant isolation.
387+
serialization and tenant isolation.
388388
389389
Args:
390-
timeout: Maximum duration to wait for the invoked function to complete.
391-
Default is no timeout. Use this to prevent long-running invocations
392-
from blocking execution indefinitely.
393-
394390
serdes_payload: Custom serialization/deserialization for the payload
395391
sent to the invoked function. Defaults to DEFAULT_JSON_SERDES when
396392
not set.
@@ -404,16 +400,10 @@ class InvokeConfig(Generic[P, R]):
404400
"""
405401

406402
# retry_strategy: Callable[[Exception, int], RetryDecision] | None = None
407-
timeout: Duration = field(default_factory=Duration)
408403
serdes_payload: SerDes[P] | None = None
409404
serdes_result: SerDes[R] | None = None
410405
tenant_id: str | None = None
411406

412-
@property
413-
def timeout_seconds(self) -> int:
414-
"""Get timeout in seconds."""
415-
return self.timeout.to_seconds()
416-
417407

418408
@dataclass(frozen=True)
419409
class CallbackConfig:

src/aws_durable_execution_sdk_python/operation/invoke.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def execute(self, _checkpointed_result: CheckpointedResult) -> R:
166166
ExecutionError: If suspend doesn't raise (should never happen)
167167
"""
168168
msg: str = f"Invoke {self.operation_identifier.operation_id} started, suspending for completion"
169-
suspend_with_optional_resume_delay(msg, self.config.timeout_seconds)
169+
suspend_with_optional_resume_delay(msg, None)
170170
# This line should never be reached since suspend_with_optional_resume_delay always raises
171171
error_msg: str = "suspend_with_optional_resume_delay should have raised an exception, but did not."
172172
raise ExecutionError(error_msg) from None

tests/config_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def test_invoke_config_defaults():
282282
"""Test InvokeConfig defaults."""
283283
config = InvokeConfig()
284284
assert config.tenant_id is None
285-
assert config.timeout_seconds == 0
286285

287286

288287
def test_invoke_config_with_tenant_id():

tests/context_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def test_invoke_with_name_and_config(mock_executor_class):
616616
mock_state.durable_execution_arn = (
617617
"arn:aws:durable:us-east-1:123456789012:execution/test"
618618
)
619-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(30))
619+
config = InvokeConfig[str, str]()
620620

621621
context = create_test_context(state=mock_state)
622622
[context._create_step_id() for _ in range(5)] # Set counter to 5 # noqa: SLF001
@@ -756,7 +756,6 @@ def test_invoke_with_custom_serdes(mock_executor_class):
756756
config = InvokeConfig[dict, dict](
757757
serdes_payload=payload_serdes,
758758
serdes_result=result_serdes,
759-
timeout=Duration.from_minutes(1),
760759
)
761760

762761
context = create_test_context(state=mock_state)

tests/operation/invoke_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ def test_invoke_handler_already_started_with_timeout(status):
219219
mock_result = CheckpointedResult.create_from_operation(operation)
220220
mock_state.get_checkpoint_result.return_value = mock_result
221221

222-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(30))
222+
config = InvokeConfig[str, str]()
223223

224-
with pytest.raises(TimedSuspendExecution):
224+
with pytest.raises(SuspendExecution):
225225
invoke_handler(
226226
function_name="test_function",
227227
payload="test_input",
@@ -246,7 +246,7 @@ def test_invoke_handler_new_operation():
246246
started = CheckpointedResult.create_from_operation(started_op)
247247
mock_state.get_checkpoint_result.side_effect = [not_found, started]
248248

249-
config = InvokeConfig[str, str](timeout=Duration.from_minutes(1))
249+
config = InvokeConfig[str, str]()
250250

251251
with pytest.raises(
252252
SuspendExecution, match="Invoke invoke8 started, suspending for completion"
@@ -285,9 +285,9 @@ def test_invoke_handler_new_operation_with_timeout():
285285
started = CheckpointedResult.create_from_operation(started_op)
286286
mock_state.get_checkpoint_result.side_effect = [not_found, started]
287287

288-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(30))
288+
config = InvokeConfig[str, str]()
289289

290-
with pytest.raises(TimedSuspendExecution):
290+
with pytest.raises(SuspendExecution):
291291
invoke_handler(
292292
function_name="test_function",
293293
payload="test_input",
@@ -311,7 +311,7 @@ def test_invoke_handler_new_operation_no_timeout():
311311
started = CheckpointedResult.create_from_operation(started_op)
312312
mock_state.get_checkpoint_result.side_effect = [not_found, started]
313313

314-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(0))
314+
config = InvokeConfig[str, str]()
315315

316316
with pytest.raises(SuspendExecution):
317317
invoke_handler(
@@ -1026,7 +1026,7 @@ def test_invoke_immediate_response_with_timeout_immediate_success():
10261026
succeeded = CheckpointedResult.create_from_operation(succeeded_op)
10271027
mock_state.get_checkpoint_result.side_effect = [not_found, succeeded]
10281028

1029-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(30))
1029+
config = InvokeConfig[str, str]()
10301030

10311031
result = invoke_handler(
10321032
function_name="test_function",
@@ -1061,10 +1061,10 @@ def test_invoke_immediate_response_with_timeout_no_immediate_response():
10611061
started = CheckpointedResult.create_from_operation(started_op)
10621062
mock_state.get_checkpoint_result.side_effect = [not_found, started]
10631063

1064-
config = InvokeConfig[str, str](timeout=Duration.from_seconds(30))
1064+
config = InvokeConfig[str, str]()
10651065

1066-
# Verify operation suspends with timeout
1067-
with pytest.raises(TimedSuspendExecution):
1066+
# Verify operation suspends
1067+
with pytest.raises(SuspendExecution):
10681068
invoke_handler(
10691069
function_name="test_function",
10701070
payload="test_input",

0 commit comments

Comments
 (0)