[BUG] Instrumenting tokio bounded channels changes the behaviour

#16 · closed · 2 comments

View on GitHub ↗

tqwewe

I've added support for channels-console in kameo behind a feature flag, but when enabled, it breaks some existing tests: The two tests are: https://github.com/tqwewe/kameo/blob/68a0e9108bc3bf7bcab950ff0c234f468bfa6d03/src/request/tell.rs#L803-L865 https://github.com/tqwewe/kameo/blob/68a0e9108bc3bf7bcab950ff0c234f468bfa6d03/src/request/ask.rs#L1235-L1298 I haven't look too much into whats causing the bug exactly, but it would be my assumption that instrumenting channels should not change any existing behaviour, and anything that does change behaviour would be considered a bug.

Comments

pawurb

Hi, as described here: https://github.com/pawurb/channels-console?tab=readme-ov-file#a-note-on-accuracy, this lib works by adding inner and outer proxy channels, effectively tripling the capacity. Failing test assumes buffer of size 1 and enabling `channels-console` increases it to 3, causing the error. I cannot think of any lib-level changes that can fix it. If you can design test with buffer of 3 and later reduce it to 1 when feature flag is enabled it should work.

tqwewe

I see thanks for the explanation. I managed to solve it, but interestingly had to fill it with 5 messages instead of the expected 3. https://github.com/tqwewe/kameo/blob/cca1abc2d12e8b7a6b410b821282773f8ab677fc/src/request/tell.rs#L844-L858