Async activity logs are appearing even after activity is timed out and workflow is completed

Hi,

I am using Async activity completion to complete an activity which relies on an asynchronous message published. The whole workflow is working really well.
I have an activity which returns Activity.getExecutionContext().doNotCompleteOnReturn and when a message is arrived in queue, I mark the activity complete using Async Activity Completion client.

When message doesn’t arrive within configured time, activity times out correctly and workflow completed as expected.

The issue that I am noticing is I have an exceptionally block which handles the exception thrown by the activity which completes with Activity.getExecutionContext().doNotCompleteOnReturn.

That exceptionally block is getting executed hours and days later with the same workflow id in thread, I have the log statement for that.

I am wondering why the thread is still alive even after workflow is completed and activity is timed out. Can someone please explain if

I think Activity.getExecutionContext().doNotCompleteOnReturn is not meant to complete the thread execution, is meant to leave the thread alive until successful completion?

I have just added some pseudocode below to explain what is happening. I am seeing log entries added in logJobOrderException method hours and days later.

function(() -> activity.jobOrderActivity()).exceptionally(e -> logJobOrderException(e,orderId)));
orderActivity: {
Activity.getExecutionContext().doNotCompleteOnReturn();
return null;
}