Skip to content

Sometimes context.current_utc_datetime intermittently evaluates to None #241

@timtylin

Description

@timtylin

To be honest, I'm not too sure how to replicate this reliably, so at this stage I'm more looking more for some help on how to nail this down.

I'm currently facing an issue where deployed durable functions (I don't really see this locally) would sometimes return None when trying to evaluate context.current_utc_datetime. I have many places in the orchestrator where I'm recording timestamps to a database entry, so this is something I use often. This can happen at any one of the many evaluations of context.current_utc_datetime throughout the run, and I can't seem to find rhyme or reason as to what causes this.

I've noticed that repeatedly evaluating context.current_utc_datetime in a for loop would eventually return a valid timestamp, so I've monkey-patched this hack into the orchestrator:

    def get_current_utc_datetime() -> datetime:
        curr_time = context.current_utc_datetime
        while not curr_time:
            sleep(0.05)
            curr_time = context.current_utc_datetime
        return curr_time

However today, I'm seeing several orchestrator runs where it's just blocking, seemingly forever, on this hack-y for loop without end, for over 30 minutes, which is much longer than I though an orchestrator is allowed to run. I've had to manually stop the entire deployed Functions App in order to try again with another orchestrator instance, but so far it's all been hitting the same problem.

This is all with beta 11, within the last couple of weeks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions