david-streamlio opened a new issue #9966: URL: https://github.com/apache/pulsar/issues/9966
**Is your enhancement request related to a problem? Please describe.** When an IO connector that implements the BatchPushSource interface wants to fail a task, it publishes a `ErrorNotifierRecord` to the internal queue. However, the exception isn't thrown until the readNext method reads the message from the internal queue. This results in an unnecessary delay between the time the error condition was encountered and the time when the exception is thrown. In addition, a lot of records are processed that shouldn't be if the task is going to get re-processed (duplicate data), etc. **Describe the solution you'd like** Change the logic in the consume method to check for the presence of a `ErrorNotifierRecord` and throw the exception then rather than inside the `readNext()` method **Describe alternatives you've considered** Leaving the code as-is -- 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]
