fix(rpc): additional logs#1175
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds richer, structured logging around GUI RPC request sending, server-side receipt/execution, and response publishing to improve observability and debugging of RPC timing and failures.
Changes:
- Add client-side RPC logs and attach timing/identifying metadata (
sent_at,deadline,timeout, etc.) to outgoing RPC messages. - Add server-side logs for RPC receipt latency, execution duration, and “stale/late” request/response detection.
- Add unit tests validating the new logging behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bec_widgets/utils/rpc_server.py |
Adds receipt/execution/response logs, timing helpers, and “stale/late” warnings on the server side. |
bec_widgets/cli/rpc/rpc_base.py |
Adds request/response logging and enriches outgoing RPC metadata with timing/identity fields. |
tests/unit_tests/test_rpc_server.py |
Adds tests asserting server logs for publish status and late-deadline handling. |
tests/unit_tests/test_rpc_base.py |
Adds a test asserting client-side timeout logging + metadata population on timeout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
00fa1a9 to
bfea216
Compare
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
b709803 to
2440df4
Compare
2440df4 to
5b54ab1
Compare
5b54ab1 to
f9995c8
Compare
f9995c8 to
a37eee0
Compare
fe24f92 to
0432fd2
Compare
0432fd2 to
439de09
Compare
ff729c2 to
0e73447
Compare
0e73447 to
6670e47
Compare
6670e47 to
a37eee0
Compare
a976abb to
674048d
Compare
Description
CHANGE TO SHUTDOWN FROM CLIENT →
test_available_widgetsreveled that with additional logs there is a delay in shutdown and the previous logic was not robust enough. The shutdown was reviewed and adjusted.Adds RPC timeout diagnostics for BEC Widgets so client, dispatcher, and RPC server logs can be correlated by
request_id.Also:
5sto60sbec_lib.scan_itemslogs in BEC WidgetsWhat Is Logged
Client side:
Dispatcher side:
RPC server side:
on_rpc_updateQTimer.singleShotImportant Log Fields
request_id: correlate logs for one RPC callmethod: RPC method/actionreceiver/gui_id: target and handling GUI server idstarget_gui_id: target widget/object idobject_name: client-side proxy nametimeout: client RPC timeoutdispatch_latency_s: client send to dispatcher receiptstale_on_dispatch: dispatcher received after client deadlinereceive_latency_s: client send toon_rpc_updatestale_on_receive: RPC handler started after client deadlineexecution_duration_s: RPC method execution timeresponse_after_client_deadline: execution finished after client deadlineaccepted: response success state→ commit left in case we would like to reenableargs/kwargs: bounded RPC method argumentsAdditional Comments
Also exclude launcher check for non-parented widgets for BECMainWindow which was triggering lot of false positive logs since MainWindow do not need to be parented to launch window.
This distinguishes Redis/dispatcher delay, Qt/RPC handler delay, slow/stuck widget execution, and responses published too late for the client.