Tectu / malloy

A cross-platform C++20 library providing embeddable server & client components for HTTP and WebSocket.
BSD 3-Clause "New" or "Revised" License
68 stars 8 forks source link

[Bug] action_queue may execute actions unqueued when starting from empty #87

Closed 0x00002a closed 3 years ago

0x00002a commented 3 years ago

This is mostly for tracking, I think I've fixed it but I'm just testing it currently. The issue is that action_queue may execute actions unqueued if it is empty when the first action is queued and the first action takes longer to complete than the code to the next push.

e.g.:

auto conn = // websocket::connection<...>
conn->send(...);
conn->send(...); // This may cause an issue as both async_write's get executed at once
Tectu commented 3 years ago

Wow, this is a nasty one...

We might be able to add some dummy code which performs a long-lasting action which is only used during testing?