MINOR: Do not wait for first line of console consumer output since we now have a more reliable test using JMX#3447
Conversation
… now have a more reliable test using JMX Waiting for the first line of output was added in KAFKA-2527 when JmxMixin was originally added as a heuristic to determine when the process was ready. We've since determined this is not good enough given JmxTool's limitations and now include a separate, more reliable check before starting JmxTool. This check is also dangerous since a consumer that is started before data is available in the topic, it won't output anything to stdout and only logs errors to a separate log file. This means we may have a long delay between starting the process and starting JMX monitoring. Since we have a more reliable check for liveness via JMX now (and in cases that need it, partition assignment metrics via JMX), we should no longer need to wait for the first line of output.
|
@apurvam @ijuma This is particularly sensitive code since it's used everywhere so I'm doing at least one full round of tests here: https://jenkins.confluent.io/job/system-test-kafka-branch-builder/941 I found this because of a timeout in an external test, but realized we could refine the last patch that added the There is a slight change in behavior in this version because we only wait for JMX not the first message, where the first message would normally indicate a message had been consumed and therefore also indicates assignment must have happened. I'm honestly not sure if we have tests that depend on that behavior (unless there's some other output that may happen too, but I think we split out stdout, stderr, and log for just that reason). I am wondering if we should just put a |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Thanks for the PR. Is there any downside to adding the |
|
To be honest, I'm not sure if there is a downside. I doubt any tests would rely on not waiting, but I can't be sure. Also, it would still only apply to the new consumer. I can update the patch and re-run tests, but there are also some tests failing that I need to check on -- some of them do seem to be related to the consumer, but not sure if they are new failures or the same as the nightly failures we saw recently. |
|
Actually @ijuma I take it back. After writing the code I realize that adding that check doesn't really do anything. It would just be between the JMX code and the for loop over output. Since getting any stdout output would require that we've been assigned partitions, the loop effectively enforces that condition. The only thing we would gain by adding that check is some notification that we never successfully assigned partitions in the case that we get no output, but that seems like a very unusual case that we probably don't need to specifically catch. |
|
I agree with @ewencp that adding the However, we do have tests that don't depend on consuming messages, but do depend on having partitions assigned, like the In particular, in the That is the only use of |
|
Thanks, I'll merge back to 0.10.1 since that's how far back I merged the other fix. 0.10.1 will need a manual merge, but it should be straightforward. |
… now have a more reliable test using JMX Waiting for the first line of output was added in KAFKA-2527 when JmxMixin was originally added as a heuristic to determine when the process was ready. We've since determined this is not good enough given JmxTool's limitations and now include a separate, more reliable check before starting JmxTool. This check is also dangerous since a consumer that is started before data is available in the topic, it won't output anything to stdout and only logs errors to a separate log file. This means we may have a long delay between starting the process and starting JMX monitoring. Since we have a more reliable check for liveness via JMX now (and in cases that need it, partition assignment metrics via JMX), we should no longer need to wait for the first line of output. Author: Ewen Cheslack-Postava <me@ewencp.org> Reviewers: Ismael Juma <ismael@juma.me.uk>, Apurva Mehta <apurva@confluent.io> Closes #3447 from ewencp/dont-wait-first-line-console-consumer (cherry picked from commit d663005) Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
… now have a more reliable test using JMX Waiting for the first line of output was added in KAFKA-2527 when JmxMixin was originally added as a heuristic to determine when the process was ready. We've since determined this is not good enough given JmxTool's limitations and now include a separate, more reliable check before starting JmxTool. This check is also dangerous since a consumer that is started before data is available in the topic, it won't output anything to stdout and only logs errors to a separate log file. This means we may have a long delay between starting the process and starting JMX monitoring. Since we have a more reliable check for liveness via JMX now (and in cases that need it, partition assignment metrics via JMX), we should no longer need to wait for the first line of output. Author: Ewen Cheslack-Postava <me@ewencp.org> Reviewers: Ismael Juma <ismael@juma.me.uk>, Apurva Mehta <apurva@confluent.io> Closes #3447 from ewencp/dont-wait-first-line-console-consumer (cherry picked from commit d663005) Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
… now have a more reliable test using JMX Waiting for the first line of output was added in KAFKA-2527 when JmxMixin was originally added as a heuristic to determine when the process was ready. We've since determined this is not good enough given JmxTool's limitations and now include a separate, more reliable check before starting JmxTool. This check is also dangerous since a consumer that is started before data is available in the topic, it won't output anything to stdout and only logs errors to a separate log file. This means we may have a long delay between starting the process and starting JMX monitoring. Since we have a more reliable check for liveness via JMX now (and in cases that need it, partition assignment metrics via JMX), we should no longer need to wait for the first line of output. Author: Ewen Cheslack-Postava <me@ewencp.org> Reviewers: Ismael Juma <ismael@juma.me.uk>, Apurva Mehta <apurva@confluent.io> Closes #3447 from ewencp/dont-wait-first-line-console-consumer (cherry picked from commit d663005) Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
Waiting for the first line of output was added in KAFKA-2527 when JmxMixin was originally added as a heuristic to
determine when the process was ready. We've since determined this is not good enough given JmxTool's limitations
and now include a separate, more reliable check before starting JmxTool. This check is also dangerous since a
consumer that is started before data is available in the topic, it won't output anything to stdout and only logs
errors to a separate log file. This means we may have a long delay between starting the process and starting JMX
monitoring.
Since we have a more reliable check for liveness via JMX now (and in cases that need it, partition assignment
metrics via JMX), we should no longer need to wait for the first line of output.