azure-functions-powershell-worker icon indicating copy to clipboard operation
azure-functions-powershell-worker copied to clipboard

$triggerMetadata.isReplaying is always True after the first Invoke-ActivityFunction

Open kwill-MSFT opened this issue 4 years ago • 6 comments

In C#, the context.IsReplaying property would reflect the replaying status up to that line of code. But in Powershell, once the first activity function is called, then the value of $triggerMetadata.isReplaying is always true for every line of code executed after that.

IsReplaying is critical for logging - without it I can only effectively log from the very beginning or the very end of an orchestrator function, but nowhere in between.

kwill-MSFT avatar Jun 25 '21 14:06 kwill-MSFT

Any news on this, in particular how to determine if the orchestrator function is replaying in a PowerShell context? Can't find any documentation no this point. Thanks!

sayertherebel avatar Dec 07 '21 17:12 sayertherebel

@sayertherebel: Unfortunately, there's no updates at the moment, but I've taken over this feature and I should be able to prioritize this shortly after the end-of-year holidays.

davidmrdavid avatar Dec 14 '21 00:12 davidmrdavid

Any update on that issue please? Using PowerShell 7. I don't even have the property "isReplaying" in the $triggerMetadata, I only have Input and nothing related to replay info.

I guess it's not a big development since I can see the replay status on the Host log file

2022-02-18T12:44:43.261 [Information] **************: Function '*********** (Orchestrator)' completed. ContinuedAsNew: False. IsReplay: False.

Thanks

HoLengZai avatar Feb 22 '22 06:02 HoLengZai

I'm also curious if there's any update. This is a big issue when logging from an orchestration, options currently are:

  • Logging everything multiple times from orchestration, for each replay every log line is logged (logs are very polluted and unusable)
  • Logging only until [something is done / any activity is awaited] (there are no logs)

Both scenario's aren't a viable solution.

Suggestion: Creating a global cmdlet like Get-AzureFunctionIsReplaying would solve the issue (not sure about implementation though).

snerte avatar Mar 30 '23 12:03 snerte

Hi all, apologies for the delayed response here. We have a more reliable implementation of the IsReplayng flag in the new SDK that was recently announced here. Although that new package SDK is currently in public preview, the plan is to GA it soon given that it contains critical bug fixes such as this one. Just wanted to drop a note in case folks are interesting in trying it out and providing feedback. Thank you!

davidmrdavid avatar Jun 12 '23 22:06 davidmrdavid

Hi @snerte, @HoLengZai, @sayertherebel, @kwill-MSFT - thank you for using Durable Functions! I'm a PM working on DF and would love to learn about your experience. If your time allows, please grab a meeting with us here. Understanding the problems you're trying to solve will help us target future development. Thanks!

lilyjma avatar Mar 04 '24 16:03 lilyjma