You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parser wait for template functionality does not work correctly. It does not wait for any template, because of bogus wait implementation.
The following code should wait for specific template to be available in ElasticSearch [1]
functionwait_for_template {
local template_name="$1"local MASTER_URL="<%= p("logstash.output.elasticsearch.data_hosts").first %>:9200"set +e
whiletrue;doecho"Waiting for index template to be uploaded: $template_name"
curl -X HEAD -f -i "$MASTER_URL"/_template/$template_name> /dev/null 2>&1
[ $? ] &&break
sleep 5
doneset -e
echo"Found $template_name"
}
But actually the [ $? ] && break statement is fully evaluated, which causes the loop to break, even if the curl exited with a non-zero status. Changing the statement to [ $? -eq 0 ] && break should do the trick.
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.
The labels on this github issue will be updated when the story is started.
PR #249 proposes a fix for the issue. However, if the template is not found within 30 seconds, Monit will give up on starting the process and report an error.
From the Monit documentation:
In the case of a process check, Monit will wait up to 30 seconds for the
start/stop action to finish before giving up and report an error.
You can override this timeout using the TIMEOUT option.
Do you think 30 seconds are sufficient for this , or we should add with TIMEOUT option to the Monit start command?
Parser wait for template functionality does not work correctly. It does not wait for any template, because of bogus wait implementation.
The following code should wait for specific template to be available in ElasticSearch [1]
But actually the
[ $? ] && break
statement is fully evaluated, which causes the loop to break, even if thecurl
exited with a non-zero status. Changing the statement to[ $? -eq 0 ] && break
should do the trick.[1]
logsearch-boshrelease/jobs/parser/templates/bin/parser_ctl
Lines 9 to 22 in ee8467b
The text was updated successfully, but these errors were encountered: