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

fix(qe): fix error logging #16287

Merged
merged 18 commits into from
Nov 25, 2022
Merged

fix(qe): fix error logging #16287

merged 18 commits into from
Nov 25, 2022

Commits on Nov 24, 2022

  1. Remove confusing comment

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    2dba9fa View commit details
    Browse the repository at this point in the history
  2. Add support for single point of error logging

    In case error logging is enabled in the client, a middleware
    captures errors and uses the event emitter to notify about them. This way, errors are captured in the same way accross the different engines, by capturing errors one level above in the call stack (at the client level)
    
    After this approach is validated, next commits will:
    - Filter the kind of errors that should be logged
    - Create the appropriate structure for the logging event being emitted
    - Add unit tests to check the behavior with the binary engine.
    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    3282b23 View commit details
    Browse the repository at this point in the history
  3. log at the request level instead of through a middleware

    Our middleware is FIFO (a queue rather than an actual stack) so the first middleware would call on other middlewares defined by the user before hitting the actual request. As we don't want to observe on users's middleware errors, I moved the logic from a middleware to the point where the request is being made.
    
    Also notice we don't want to block on user handling code upon request resolving, so the error handling code runs asynchronously. This has a side effect. If the execution of the program halts, before the promise is resolved in the next event loop tick, then the error won't be logged. This might not be an acceptable trade-off, and I might change it in a follow-up commit.
    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    46c958c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3b1f4bc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9a9d2be View commit details
    Browse the repository at this point in the history
  6. Update RequestHandler.ts

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    2b15160 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fc14e4c View commit details
    Browse the repository at this point in the history
  8. Do not depend on Node type

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    840b010 View commit details
    Browse the repository at this point in the history
  9. Omit error, and instead warn when retrying

    Error will flow up the stack and be captured by the RequestHandler
    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    15b90ff View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ded3d9f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f08eb40 View commit details
    Browse the repository at this point in the history
  12. Emit a clearer event

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    f273a6d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    cec72ef View commit details
    Browse the repository at this point in the history
  14. Tests

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    a786754 View commit details
    Browse the repository at this point in the history
  15. Update packages/client/tests/functional/query-error-logging/_matrix.ts

    Co-authored-by: Daniel Starns <danielstarns@hotmail.com>
    2 people authored and miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    87f8a2b View commit details
    Browse the repository at this point in the history
  16. Not import runtime in tests

    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    77dc62d View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    72f7e43 View commit details
    Browse the repository at this point in the history
  18. Simplify BinaryEngine

    This change is about:
    1. getting rid of lastErrorLog, lastRustError, lastPanic
    state and instead build all the error information when we parse a log line if that's pertinent
    
    2. Let request errors flow up the stack instead to be emitted in the RequestHandler.
    
    3. Only emit events explicitly during lifecycle management of the binary engine
    miguelff committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    ef408ae View commit details
    Browse the repository at this point in the history