Skip to content

fix(communication): reject non-positive service call timeout_sec#819

Open
Bartok9 wants to merge 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/service-reject-nonpositive-timeout
Open

fix(communication): reject non-positive service call timeout_sec#819
Bartok9 wants to merge 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/service-reject-nonpositive-timeout

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Gate ROS2ServiceAPI.call_service so timeout_sec must be a finite number > 0. Bool and non-numeric values raise TypeError; non-positive values raise ValueError before any request build or client touch.

Shared helper: rai.communication.timeout_validate.require_positive_timeout (ROS-free).

Test plan

  • Offline: pytest tests/communication_offline/test_service_timeout_validate.py (7 passed)
  • CI green

Notes

Small fail-closed guard; default timeout_sec=5.0 behavior unchanged for valid callers. AI-assisted; human-reviewed.

Add require_positive_timeout helper and gate ROS2ServiceAPI.call_service
before building the request or touching clients. Offline unit tests cover
bool/non-numeric/non-positive cases.
@maciejmajek
maciejmajek changed the base branch from main to bartok9/fixes July 22, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant