Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public LongRunningAction(Uid rcvUid) {
*/
public LRAData getLRAData() {
return new LRAData(id, clientId, status, isTopLevel(), isRecovering(),
startTime.toInstant(ZoneOffset.UTC).toEpochMilli(),
startTime == null ? 0L : startTime.toInstant(ZoneOffset.UTC).toEpochMilli(),
Copy link
Member

Choose a reason for hiding this comment

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

If startTime is null then the action was never started so filling in the time is misleading and according to the LRAStatus model it doesn't really exist. It's better to track down the circumstances under which this condition can occur and fix it there. The creation of the LRA and starting it should effectively be a single action, for example in LRAService#startLRA the code that creates and starts the LRA should be inside a try catch block if that is the source of the error. There may be other places to check as well but, off the top of my head, LRAService is the only place where we create LRAs.

Copy link
Member

@mmusgrov mmusgrov Feb 24, 2026

Choose a reason for hiding this comment

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

Do you know how you managed to create the LRA without a status and/or a start time.

Copy link
Member Author

@marcosgopen marcosgopen Feb 25, 2026

Choose a reason for hiding this comment

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

I could see the nullpointer exception running the quarkus microprofile-tck. It occurs with the completionStage. I will reproduce it and link the error message here to better identify the case

Copy link
Member

Choose a reason for hiding this comment

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

The error message would be reported long after the area of the code where it failed to set a start time. If we can't track the cause then I think it would be better to leave the startTime as null and report it as such in the getLRAData call. Can we at least log what it thinks the status of the LRA is plus logging from any other parts of the code where we think the cause is? I would certainly suggest that the bit of code where we create and then start the LRA is enclosed in a try catch block.

finishTime == null ? 0L : finishTime.toInstant(ZoneOffset.UTC).toEpochMilli(),
getHttpStatus());
}
Expand Down