Skip to content

Handle IPC receive socket construction failures safely - #791

Open
sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/ipc-receive-socket-construction
Open

Handle IPC receive socket construction failures safely#791
sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/ipc-receive-socket-construction

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Description

Fix the socket-construction failure path in SimpleReceiveExternalStepPy.

The node creates its listening socket inside a try block and catches OSError, but the handler unconditionally calls ls.close(). If socket.socket() itself raises before ls is assigned, the handler raises UnboundLocalError and masks the original recoverable socket failure.

Initialize ls to None and close it only when construction progressed far enough to create a socket. The node then returns False as intended and can retry on a later evaluation.

Validation

  • focused regression test forces socket.socket() itself to raise OSError
  • verifies compute() returns False without a secondary exception
  • verifies no listening socket or URI state is committed
  • normal bind/listen/accept behavior is unchanged
  • production diff is three additions and one replacement

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