microsoft / durabletask-java

Java SDK for Durable Functions and the Durable Task Framework
MIT License
13 stars 7 forks source link

Make timer task non-blocking #161

Closed kamperiadis closed 1 year ago

kamperiadis commented 1 year ago

Issue describing the changes in this PR

Resolves #136

Cause: When timers are longer than 3 days, we break them up into smaller timers that are 3-day long. However, there was a bug in this logic where we were blocking execution for those smaller timers. This explains why when we have an anyOf statement between an external event and a timer longer than 3 days, the external event is missed - we were still just waiting for that long timer to complete. Solution: We have implemented the timer logic to be asynchronous.

Pull request checklist

kamperiadis commented 1 year ago

Thank you for pointing that out @cgillum. I see how creating the timers in advance would not work since that would mean creating timers that are long. I will work on fixing this implementation. Thank you.

kamperiadis commented 1 year ago

@cgillum @davidmrdavid @kaibocai @shreyas-gopalakrishna Can you please help me review this PR whenever you get a chance? Thank you!

kamperiadis commented 1 year ago

Good point @cgillum! I just enhanced the longTimer test as per your suggestion. Thank you.