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

NPE fix #1574

Merged
merged 2 commits into from
Oct 3, 2024
Merged

NPE fix #1574

merged 2 commits into from
Oct 3, 2024

Conversation

bradNASA
Copy link
Contributor

@bradNASA bradNASA commented Oct 2, 2024

NPE fix, untested

@bradNASA bradNASA requested a review from a team as a code owner October 2, 2024 23:46
@mattdailis mattdailis requested review from mattdailis and removed request for cohansen and JoelCourtney October 3, 2024 03:27
Copy link
Collaborator

@mattdailis mattdailis left a comment

Choose a reason for hiding this comment

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

Thank for the fix, I've run into this a number of times myself. This can occur if a daemon task spawns an activity, and that activity doesn't finish by the end of simulation

DirectiveId used to be computed from activityParents, but as of
recently it is computed separately. This commit uses it directly
@mattdailis
Copy link
Collaborator

Discussed with Theresa, and we decided to refactor these two lines of code:

(activityParents.containsKey(span)) ? Optional.empty() : Optional.ofNullable(directiveId),

To this:

+(activityParents.containsKey(span)) ? Optional.empty() : Optional.ofNullable(directiveId)
-Optional.ofNullable(directiveId)

The ternary dates back to a time when we used the absence of a parent span to determine whether a span is "top level", and assumed that all top level spans came from the plan. Now, we have a more direct way to compute directive ids, which is robust to the situation where a parent-less span comes from a daemon task rather than a directive in the plan.

@dandelany
Copy link
Collaborator

Thanks all! Merging this fix.

@dandelany dandelany merged commit aff0fba into develop Oct 3, 2024
10 checks passed
@dandelany dandelany deleted the fix/ofnullable branch October 3, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants