Skip to content

sendScriptBlocking: Restart interface and resend script on readOnlyInterfaceException#522

Merged
urfeex merged 14 commits into
UniversalRobots:masterfrom
URJala:send_script_blocking_retry_readonly
Jun 17, 2026
Merged

sendScriptBlocking: Restart interface and resend script on readOnlyInterfaceException#522
urfeex merged 14 commits into
UniversalRobots:masterfrom
URJala:send_script_blocking_retry_readonly

Conversation

@URJala

@URJala URJala commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Implements functionality to restart primary interface and retry execution of script code, if the interface was initially in read-only mode


Note

Medium Risk
Changes robot script execution by stopping/restarting the primary pipeline on read-only errors; default-on retry alters failure timing and connection state for integrators.

Overview
sendScriptBlocking gains a retry_on_readonly_interface flag (default true). On ReadOnlyInterfaceException (robot error C210), it stops and restarts the primary client pipeline, then retries script upload and monitoring once; with retry disabled, behavior is unchanged.

The blocking send/monitor loop is moved into a new private sendScriptMonitorExecution; sendScriptBlocking keeps pre-checks (robot mode, safety) and wraps execution with that retry logic. The start-wait parameter is renamed start_timeout (docs updated), and private helpers are renamed to camelCase (prepareScript, etc.). sendScript docs now clarify upload-only vs blocking feedback.

Fake-server tests cover retry off, retry success after C210 on first attempt, and persistent read-only after reconnect.

Reviewed by Cursor Bugbot for commit 572da92. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.86%. Comparing base (915eafe) to head (572da92).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
- Coverage   78.95%   78.86%   -0.09%     
==========================================
  Files         116      116              
  Lines        6689     6696       +7     
  Branches     2953     2960       +7     
==========================================
  Hits         5281     5281              
- Misses       1040     1046       +6     
- Partials      368      369       +1     
Flag Coverage Δ
check_version_ur10-3.15.8 10.66% <0.00%> (-1.49%) ⬇️
check_version_ur10e-10.11.0 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur10e-5.15.2 11.23% <0.00%> (-0.07%) ⬇️
check_version_ur12e-10.12.1 11.32% <0.00%> (+0.07%) ⬆️
check_version_ur12e-5.25.1 11.23% <0.00%> (-0.21%) ⬇️
check_version_ur15-10.12.1 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur15-5.25.1 11.42% <0.00%> (-0.24%) ⬇️
check_version_ur16e-10.12.1 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur16e-5.25.1 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur18-10.12.1 11.23% <0.00%> (-0.07%) ⬇️
check_version_ur18-5.25.1 11.23% <0.00%> (-0.21%) ⬇️
check_version_ur20-10.12.1 11.23% <0.00%> (-0.07%) ⬇️
check_version_ur20-5.25.1 11.42% <0.00%> (+0.17%) ⬆️
check_version_ur3-3.14.3 12.69% <0.00%> (+1.25%) ⬆️
check_version_ur30-10.12.1 11.27% <0.00%> (-0.07%) ⬇️
check_version_ur30-5.25.1 11.42% <0.00%> (+0.17%) ⬆️
check_version_ur3e-10.11.0 11.27% <0.00%> (-0.07%) ⬇️
check_version_ur3e-5.9.4 11.23% <0.00%> (-0.21%) ⬇️
check_version_ur5-3.15.8 11.23% <0.00%> (-0.10%) ⬇️
check_version_ur5e-10.11.0 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur5e-5.12.8 11.27% <0.00%> (-0.07%) ⬇️
check_version_ur7e-10.11.0 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur7e-5.22.2 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur8long-10.12.1 11.23% <0.00%> (-0.02%) ⬇️
check_version_ur8long-5.25.1 11.23% <0.00%> (-0.21%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 83.57% <ø> (-0.90%) ⬇️
ur5-3.14.3 74.91% <100.00%> (+0.19%) ⬆️
ur5e-10.11.0 69.25% <100.00%> (+0.12%) ⬆️
ur5e-10.12.0 70.27% <100.00%> (+0.06%) ⬆️
ur5e-10.7.0 68.85% <100.00%> (-0.07%) ⬇️
ur5e-5.9.4 75.23% <100.00%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread tests/test_primary_client.cpp Outdated
Comment thread tests/test_primary_client.cpp Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 31129a8. Configure here.

Comment thread src/primary/primary_client.cpp Outdated
Comment thread src/primary/primary_client.cpp
@urfeex urfeex merged commit e61b18d into UniversalRobots:master Jun 17, 2026
53 of 64 checks passed
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.

2 participants