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

Add evaluation error reporting for expressions #4342

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

jpbempel
Copy link
Member

What Does This Do

Reports runtime evaluation error (like NPE) into snapshots in evaluationErrors attribute.

Motivation

Additional Notes

Reports runtime evaluation error (like NPE) into snapshots
in evaluationErrors attribute.
@jpbempel jpbempel requested a review from a team as a code owner November 29, 2022 12:14
@jpbempel jpbempel requested review from cimi and removed request for a team November 29, 2022 12:14
@jpbempel jpbempel requested review from a team and removed request for cimi November 29, 2022 14:00
@jpbempel jpbempel added the comp: debugger Dynamic Instrumentation label Nov 29, 2022
@jpbempel jpbempel requested review from a team and ojung and removed request for a team November 29, 2022 14:43
Copy link
Contributor

@shatzi shatzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think we need to test more dedup scenarios but it could be it's own PR

List<ProbeDetails> additionalProbes = probe.additionalProbes;
if (!additionalProbes.isEmpty()) {
for (ProbeDetails additionalProbe : additionalProbes) {
if (executeScript(additionalProbe.getScript(), capture, additionalProbe.id)) {
capturingProbeIds.add(additionalProbe.id);
} else if (capture.areEvalErrors()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there is a bug here. if we have multiple probes and the first probe generate errors. so capture.areEvalErrors() will return true even if executeScript for the other probe return false without any errors.

We might need to clear errors before execute each script. Moreover, not sure if the errors for those probes are getting recorded

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests for de-dup probes with different conditions working/failing?

Copy link
Member Author

@jpbempel jpbempel Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I see. I will fix this in another PR. dup probes are still a special case, and not common right now.

@jpbempel jpbempel merged commit 3586edf into master Dec 2, 2022
@jpbempel jpbempel deleted the jpbempel/eval-reporting branch December 2, 2022 08:42
@github-actions github-actions bot added this to the 1.2.0 milestone Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: debugger Dynamic Instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants