gsoft-inc / wl-extensions-mediatr

MediatR extensions, behaviors and default configuration.
Apache License 2.0
5 stars 0 forks source link

IDP-573 - Fix nested activities #30

Closed Gcaya closed 1 year ago

Gcaya commented 1 year ago

Context

In terms of activity and tracing, we want to have each processed event to have the same parentId. That's not what was currently hapening. Currently every event would have the previous processed event as parent which would produce a trace similar to this:

|-- Parent Activity
|    |-- Handle request A
|        |-- Handle requestB 

But really what we want is something that looks like this:

|-- Parent Activity
|    |-- Handle request A
|    |-- Handle request B 

What changed

There seemed to be some problem with the disposal of the activity which was making it be referenced beyond it's using block and into the next processing block. In order to remedy this, the following changes were made:

Moved using statement from HandleWithTracing to HandleAsync (This alone fixed the issue that could be clearly seen in Honeycomb for example)