-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
timeout <= 0 not working for deleteTopics function #1128
Comments
Hi @aditya81070 , the comments are correct. I think this is a bug, the protocol layer for |
@tulios Thanks for quick response. Are there any plans to fix this one in upcoming release? |
I wasn't able to find any mention of timeout values <= 0 making topic deletion async. There's no KIP mentioning it and nothing in the Java client docs or anywhere else, so I think this is incorrect. I'm removing that comment in #1427 and updating the docs to include the default value. |
Describe the bug
In the deleteTopics docs, the description for
timeout
field is missing. It only says it is a number. There is no clear description of whether it is the max time taken in deleting all topics or the timeout of sending a deletion request (connecting to broker and all).To find out, how this timeout is working under the hood, I jumped into the code and found that
admin.deleteTopics
is callingbroker.deleteTopics
under the hood and it has this doc (jsdocs comments). According to this doc, iftimeout <= 0
then it will trigger the topic deletion and will return but when I provide timeout value as 0 or 1, it throwsREQUEST_TIMED_OUT
error.Are these comments up to date? If no, is there any way I can trigger topic deletion asynchronously?
The asynchronous part is important for some applications. In my case, I am writing a scheduler that will clean up stale topics daily (a lambda function) but I don't want to pay for lambda execution time until all topics are deleted. I just want to send an async deletion request and if something goes wrong, I will pick those topics in the next run.
To Reproduce
Please provide either a link to a:
Sorry, I am not running KafkaJS locally.
Not possible
If none of the above is possible to provide, please write down the exact steps to reproduce the behavior:
const admin = client.admin()
and connect to the admin usingawait admin.connect()
.await admin.deleteTopics({topics: ['an-existing-topic'], timeout: 0 or -1})
.Expected behavior
The delete request should be sent successfully and I should get an ok response from
deleteTopics
call.Observed behavior
The request failed with the
REQUEST_TIMED_OUT
exception when passing timeout as <= 0 value.Environment:
The text was updated successfully, but these errors were encountered: