launchdarkly/dotnet-server-sdk

FlushAndWait hangs when there are no events to flush

Closed this issue · 3 comments

Describe the bug
When calling client.FlushAndWait(TimeSpan.Zero) it hangs when there are no events to flush. It can happen when there were no events or they were flushed automatically or flush was called before.

To reproduce

  1. Create LdClient
  2. Evaluate a flag
  3. Trigger event flush, e.g. by calling client.Flush() or client.FlushAndWait()
  4. Call client.FlushAndWait(TimeSpan.Zero)

Expected behavior
client.FlushAndWait(TimeSpan.Zero) finishes work correctly if there are no events

SDK version
7.0.0

Language version, developer tools
net6.0

Additional context
The client is used in a short lived context and we need to flush events after the execution. There is no way of knowing if there are any events yet and calling FlushAndWait could lead to a complete freeze if automatic flushing already happened. And there is no way to disable automatic flushing as well, only increase FlushInterval

Hello @MisterMiros,

Thank you for reporting this.

Filed internally as 191647

Thanks,
Ryan

@MisterMiros This has been fixed and released in 7.0.1. Thank you!

Closing because this has been released. If there are any further problems, then please open a new issue. Thank you.