Add logging of the mapping function in MapTaskObservable#2030
Add logging of the mapping function in MapTaskObservable#2030halotukozak wants to merge 3 commits intomonix:mainfrom
Conversation
…unction in MapTaskObservable.
There was a problem hiding this comment.
Pull request overview
This PR enhances diagnostics for rare MapTaskObservable state-machine failures by adding information about the mapping function to the reported IllegalStateException, to help reproduce/debug environment-specific invalid state reports.
Changes:
- Extend the invalid-state error message in
MapTaskObservableto include the executed mapping function (f).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| s"State $state in the Monix MapTask.$method implementation is invalid, " + | ||
| "due to either a broken Subscriber implementation, or a bug, " + | ||
| "please open an issue, see: https://monix.io" | ||
| s"please open an issue, see: https://monix.io. Executed function: $f" |
There was a problem hiding this comment.
Including Executed function: $f will call toString on a user-supplied function and embed it in an exception reported via scheduler.reportFailure, which can leak sensitive captured values and is often not very informative for anonymous lambdas (e.g., <function1>). Consider logging a safer, more diagnostic identifier (e.g., f.getClass.getName plus System.identityHashCode(f)), and keep the URL unpunctuated (avoid the trailing . after https://monix.io so the link copies correctly).
|
We stopped observing this behavior after introducing changes from #2031, so adding this logging might be unnecessary now. |
Original contribution from the AVSystem's fork made by @mikkolaj
AVSystem#2