Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Investigation of post-mortem debugging with Promises. #45

Closed
@uzun

Description

@uzun

I am a graduate student at the IBM Centre for Advanced Studies—Atlantic at the University of New Brunswick working with @mhdawson. We are interested in working on post-mortem debugging for promises in Node.js as part of our research and are hoping to get the group’s input as we tackle this problem. I realize from reading the Issues that there isn’t consensus on a solution and although I am not yet a Node expert myself, I am willing to dedicate time to contribute towards a possible fix.

Our current plan would be to:

  1. Develop a set of test cases that show the problem of not being able to capture stack traces, core dumps etc. for unhandled exceptions that cause promise rejections.
  2. Implement and test a number of different options based on the suggestions in the pull requests so far, as well as new ideas we come up with.
  3. Document what can or cannot be captured in each option and the overhead of doing so.
  4. Receive input on different options, tradeoffs, and iterate as required.
  5. Submit a final pull request to add the most suitable solution from the investigation above.

Some of the ideas we would plan to test would include:

  1. Capturing different levels of information (stack trace, core dump etc.) to find a good balance between the overhead and information captured.
  2. Using the V8 API to determine the reason for a promise rejection.
  3. Adopting a double-run approach. The call stack and relevant metadata for an unhandled rejection are captured on the first pass. Then during the second pass, the rejections are tracked and compared with previous data to determine if a core dump is necessary. We want to analyze when to output or abort and whether it is preferential to do so immediately.
  4. Experimenting with when to capture information or abort and the impact this has on existing code using promises.
  5. Building up more information over time to help make better decisions on when to capture information.

We plan to keep this issue up to date with pointers to a fork that includes the code for the options we experiment with.

If you have any suggestions on what we should consider looking at or would like to collaborate on this effort just let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions