mdedetrich / monix-mdc

MDC Support for Monix Task using TaskLocal
MIT License
3 stars 0 forks source link

Concurrent MDC inserts with the same key fails #1

Open mdedetrich opened 5 years ago

mdedetrich commented 5 years ago

These current MDCFutureSpec fails

These tests involve putting values into MDC with the same key but different values in separate task executions. i.e. We have 2 threads of logic running at once, both threads put use the same key but they put in different values.

The equivalent test which just uses Task (i.e. MDCBasicSpec) works fine, but when we start using Task mixed with Future (along with TracingScheduler) the equivalent logic fails.

oleg-py commented 5 years ago

It's probably not the cause, but shouldn't you be using runToFutureOpt in your tests? Otherwise the option enable context propagation is ignored

mdedetrich commented 5 years ago

Thanks! I forgot to do a push (I had runToFutureOpt locally). It didn't really change anything, so the issue is still there.

What I am going to work on however is to make the tests use randomly generated values to make sure that we don't have conflicting keys.