-
Notifications
You must be signed in to change notification settings - Fork 15
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
[FCM-81] Sleep for 30 seconds to ensure Kafka is stable #49
Conversation
c32148f
to
f7d1f1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR! We are already waiting for the port to appear: - name: Wait for Kafka port
wait_for:
host: "{{ sansible_kafka_listen_address }}" What does waiting 30s before that add to this? |
@dennisconrad it's for cases when Kafka does starts up, and port 9092 is available, but then due to config error Kafka dies |
That still doesn't explain why we're waiting for 30s before we're even checking for the port :-) I would understand the other way round, but not like this. Also, is there another way to ensure Kafka is ready? Can we check a log file instead, something like... - name: Wait until Kafka is ready
wait_for:
path: /var/log/kafka/startup.log
search_regex: "^Ready\.$" ? |
ok, what about - name: Wait for Kafka port
wait_for:
host: "{{ sansible_kafka_listen_address }}"
port: "{{ sansible_kafka_port }}"
state: started
timeout: "{{ sansible_kafka_wait_for_kafka_port }}"
- name: "Check again after {{ sansible_kafka_waitfor_delay }} seconds to ensure Kafka is stable"
wait_for:
delay: "{{ sansible_kafka_waitfor_delay }}"
host: "{{ sansible_kafka_listen_address }}"
port: "{{ sansible_kafka_port }}"
state: started
timeout: "{{ sansible_kafka_wait_for_kafka_port }}" |
How about... - name: Wait for Kafka port
wait_for:
delay: "{{ sansible_kafka_waitfor_delay }}"
host: "{{ sansible_kafka_listen_address }}"
port: "{{ sansible_kafka_port }}"
state: started
timeout: "{{ sansible_kafka_wait_for_kafka_port }}"
with_items: [1, 2, 3]
If either of |
|
Sleep for 60 seconds to ensure Kafka is stable