Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2 -> 4.0] Modify trace_api_plugin to report serialization errors to user #1468

Merged
merged 11 commits into from
Jul 31, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Jul 28, 2023

The exception handler for the trace_api_plugin data handler now rethrows any exceptions so they can be reported to the API caller of /v1/trace_api/get_block and /v1/trace_api/get_transaction_trace.

trace_api_plugin will now report

./cleos --verbose --print-response get block_trace 20
RESPONSE:
---------------------
{
  "code": 500,
  "message": "Internal Service Error",
  "error": {
    "code": 2,
    "name": "timeout_exception",
    "what": "deadline 2023-07-25T20:19:49.442 exceeded by 24us ",
    "details": [{
        "message": "deadline 2023-07-25T20:19:49.442 exceeded by 24us ",
        "file": "trace_api_plugin.cpp",
        "line_number": 288,
        "method": "operator()"
      }
    ]
  }
}
---------------------
error 2023-07-25T20:19:49.445 cleos     main.cpp:4498                 operator()           ] Failed with error: 2 timeout_exception: deadline 2023-07-25T20:19:49.442 exceeded by 24us
deadline 2023-07-25T20:19:49.442 exceeded by 24us
    {}
    cleos  trace_api_plugin.cpp:288 operator()

Instead of:

./cleos --verbose --print-response get block_trace 20
RESPONSE:
---------------------
{
  "code": 404,
  "message": "Trace API: block trace missing",
  "error": {
    "code": 0,
    "name": "",
    "what": "",
    "details": []
  }
}
---------------------
Error 3200005: http request fail
Error Details:
Error code 404
: {"code":404,"message":"Trace API: block trace missing","error":{"code":0,"name":"","what":"","details":[]}}

Merges release/3.2 into release/4.0 including #1449

Resolves #1433

@heifner heifner requested review from greg7mdp and dimas1185 July 28, 2023 19:39
@heifner heifner added the OCI Work exclusive to OCI team label Jul 28, 2023
@heifner heifner merged commit 4973f63 into release/4.0 Jul 31, 2023
@heifner heifner deleted the GH-1433-trace-api-4.0 branch July 31, 2023 11:51
@arhag arhag modified the milestones: Leap v3.2.5, Leap v4.0.5 Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trace_api_plugin reports block trace missing when http-max-response-time-ms limit is reached
4 participants