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.
eea3aaf to
00fa1a9
Compare
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
Description
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 stateargs/kwargs: bounded RPC method argumentsAdditional Comments
This distinguishes Redis/dispatcher delay, Qt/RPC handler delay, slow/stuck widget execution, and responses published too late for the client.