-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors are not sent back to the caller #51
Comments
Hey @dermasmid , you should be getting a thrown error if you are awaiting producer.send, or a promise rejection if you are using "catch" on the promise returned by producer.send. It will look similar to this:
where my code was like this producer.send({
topic: 'mytopic',
messages: [
{ value: 'v222', partition: 0 },
{ value: 'v11', partition: 0, key: 'x' },
]
}).catch(console.error) The logs are an additional warning which gives you the details on how the messages timed out (some of them may be timed out in flight, some of them might have timed out in the local queue the library maintains before bunching up and sending the messages, and so on). If you do want to get every log message, you can use a custom logger, like in here - #41 (comment) . |
i did not get the error thrown to me i'm pretty sure. |
Ah, okay, there is one more possibility. For any produce requests, there are two timeouts, the The first one is on a per-protocol-message basis. If a request is inflight for more than I am guessing that's what happened here - the actual protocol request timed out, but the library dealt with it through this mechanism of internal retries. Is it possible to share the logs around the REQTMOUT thing? I might be able to confirm that theory. If you don't want any internal retry behaviour, you can disable it through certain properties, by setting the allowed number of retries to 0. kafkaJS: {
brokers: ['brokerName'],
// ...,
retry: {
retries: 0
}
}, |
Also, both |
i can share more logs, just note that i did actually loose some messages, it wasnt just the log, in fact because i saw i was missing data i went look what happened |
Oh, that should definitely not happen. Please do share the logs. Is it something you can reproduce on occasion, too? If so then it would be very good if you could turn on the full debug logs. They are quite verbose, though. |
|
Thanks for the logs, I took a look. Where is this particular log line being logged from - is it somewhere within your code? This is the error that should have been thrown by the producer.send() function on await. It doesn't have the other stuff (timestamp/fac) that's present in the library's logger. Is it possible to share the code which is producing, too? It'll probably help. Thanks.
|
this is coming from librdkafka, i had extracted it from gcp, that why it might look a little different you can see the |
Okay. Could you attach the relevant bits of code, too? I can reproduce the logging, but it's resulting in an exception thrown for me (or the other case I talked about, where the message is retried until it's sent). |
I faced a similar issue yesterday in production, the requests to Kafka are taking an indefinite time, without any timeout or error thrown. I was also using Kafkajs version.
|
Thanks @Dhruv-Garg79. Are you getting the same logging as above about the timeout? |
im using the kafkaJs variant and
producer.send
and i was observing logs like this that were not send back to the caller.The text was updated successfully, but these errors were encountered: