Skip to content

Reactor WithSpan changes return type of method #5766

@anuraaga

Description

@anuraaga

Currently, reactor WithSpan will call flatMap in a way that changes the return type of a method. It means this code works without agent but not with agent

@WithSpan
Flux<String> foo() {
  return UnicastProcessor.create();
}

main() {
  Flux<String> bar = foo();
  ((UnicastProcessor) bar).onNext("bear");
}

It breaks the "agent never crashes the app" contract though perhaps this is unavoidable and the user code is quite questionable. Well, I did randomly run into such crashing when writing unit tests for our agent so maybe I'm a questionable user :-) But outside of that maybe we just need to live with it, but reporting to check

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions