petabridge / phobos-issues

Public issues and bug tracker for Phobos®
https://phobos.petabridge.com/
2 stars 1 forks source link

Phobos 1.4.x - OpenTracing: Tracing breaks when using Ask().PipeTo() #44

Closed garethjames-imburse closed 2 years ago

garethjames-imburse commented 2 years ago

We've discovered an issue in Phobos (1.4.0 and 1.4.1) that can be seen in Jaeger when using the Ask().PipeTo() method:

myOtherActor.Ask(myMessage, TimeSpan.FromSeconds(7))
    .PipeTo(Self, sender,
        success => new MessageHandled(success),
        exception => new MessageFailed(exception));

We see a span for the actor that's asking, and the next span comes with a warning: "invalid parent span IDs=effe6a359f66ddc6; skipping clock skew adjustment".

image

However, if we modify the code to use async/await instead, it works fine:

var success = await myOtherActor.Ask(myMessage, TimeSpan.FromSeconds(7));
Context.Self.Forward(new MessageHandled(success));
Aaronontheweb commented 2 years ago

Thanks @garethjames-imburse - we will investigate. Thanks for providing a clear reproduction for us.

Arkatufus commented 2 years ago

@garethjames-imburse We've fixed this issue, however, to fully fix it, we will need to do an Akka.NET release first. The fix depends on a change in Akka.NET code here: https://github.com/akkadotnet/akka.net/pull/5684 The fix will be in effect on the next Phobos release after the next Akka.NET release.

garethjames-imburse commented 2 years ago

Thanks @Arkatufus - I'll keep an eye out for the new versions.

Arkatufus commented 2 years ago

@garethjames-imburse

The new version of Phobos with the fix is up, there is a small caveat that you need to call the new PipeTo overload and the Ask method need to be inside an async method, even when you're not awaiting it. Please read the release note for a code example.

Aaronontheweb commented 2 years ago

Documentation on how to do what @Arkatufus said is available here:

https://phobos.petabridge.com/articles/releases/RELEASE_NOTES.html#142httpssdkbincompublisherpetabridgeproductphobospackagesphobosactorversions142-march-8th-2022

garethjames-imburse commented 2 years ago

Thanks @Aaronontheweb and @Arkatufus - much appreciated.