david-streamlio opened a new issue #10509: URL: https://github.com/apache/pulsar/issues/10509
**Describe the bug** When an exception is thrown inside the sendOutputMessage method of the JavaInstanceRunnable class, since it is inside a CompletableFuture, it gets "swallowed up" and not properly reported. This can result in a scenario in which the Pulsar Function is continuing to run and process messages, but no output is getting generated. This behavior was fixed for synchronous functions in [this PR](https://github.com/apache/pulsar/pull/10370) **To Reproduce** This can be reproduced my adding a unit test to the `JavaInstanceRunnableMockTests` class that uses an async function rather than a Sync function. **Expected behavior** If there is an exception when writing the result of the Pulsar function, then the user should be notified of the situation in some way, so that we can respond accordingly. Otherwise the incoming messages will be marked as received but the corresponding output messages will be lost forever. **Screenshots** N/A **Desktop (please complete the following information):** N/A **Additional context** This will require an advanced discussion and/or possibly a PIP to design the correct solution, particularly if we wish to maintain message ordering inside the Pulsar Function itself, as the async function calls might result in out-of-order processing of the messages. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
