Skip to content
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

KAFKA-4931: stop script fails due 4096 ps output limit #3396

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

tombentley
Copy link
Contributor

This also fixes KAFKA-4389 and KAFKA-4297, which were exactly the same
issue but for kafka-server-stop.sh.

This also fixes KAFKA-4389 and KAFKA-4297, which were exactly the same
issue but for kafka-server-stop.sh.
@asfgit
Copy link

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/5563/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/5549/
Test PASSed (JDK 8 and Scala 2.12).

@omkreddy
Copy link
Contributor

omkreddy commented Jun 21, 2017

AFAIK, jps tool is not available on IBM Java. not sure, if we can use this approach.

@tombentley
Copy link
Contributor Author

I pushed a change so we use jps if it's available and fallback to using ps when it's not

@asfgit
Copy link

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/5588/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/5574/
Test PASSed (JDK 8 and Scala 2.12).

@omkreddy
Copy link
Contributor

LGTM

@kamalcph
Copy link
Collaborator

If multiple Kafka brokers are running in the same machine, which one will it stop ?

Existing script using ps command have the same problem, but now it does nothing.

@tombentley
Copy link
Contributor Author

@kamal15 it will kill all of them. Wdym "now it does nothing"?

@kamalcph
Copy link
Collaborator

No, it won't kill any server. Since the grep output is empty.

@tombentley
Copy link
Contributor Author

@kamal15 which grep output (the jps or ps one?) and if the jps one what jre/jdk are you using?

@kamalcph
Copy link
Collaborator

@tombentley

Assume that multiple brokers are running in different ports in a machine. Earlier, on invoking sh kafka-server-stop.sh due to 4096 ps output limit, we will get "No kafka server to run". So, manually we have to kill / stop the server.

Now with your changes, jps command will definitely return a PID which may or mayn't be the intended broker to stop. I'm using oracle jdk 1.8.0_121

@tombentley
Copy link
Contributor Author

@kamal15 but in environments where the 4096 limit was not hit the original script would have killed all the servers. So in that respect this patch doesn't change anything: The stop script still kills all the applicable server processes. There's a separate JIRA about this https://issues.apache.org/jira/browse/KAFKA-4110

@kamalcph
Copy link
Collaborator

@tombentley

Ok then. I'm un-aware of the Jira.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants