Skip to content

Commit 83c6cb5

Browse files
committed
Merge branch 'update/ci-elasticsearch-run' into 7.9
2 parents 634556a + 4800c5e commit 83c6cb5

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.ci/run-elasticsearch.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
# Export the TEST_SUITE variable, eg. 'oss' or 'xpack' defaults to 'oss'.
88
# Export the NUMBER_OF_NODES variable to start more than 1 node
99

10-
# Version 1.1.0
10+
# Version 1.2.0
1111
# - Initial version of the run-elasticsearch.sh script
1212
# - Deleting the volume should not dependent on the container still running
1313
# - Fixed `ES_JAVA_OPTS` config
1414
# - Moved to STACK_VERSION and TEST_VERSION
1515
# - Refactored into functions and imports
1616
# - Support NUMBER_OF_NODES
17+
# - Added 5 retries on docker pull for fixing transient network errors
1718

1819
script_path=$(dirname $(realpath -s $0))
1920
source $script_path/functions/imports.sh
@@ -67,6 +68,17 @@ if [[ "$TEST_SUITE" == "xpack" ]]; then
6768
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
6869
fi
6970

71+
# Pull the container, retry on failures up to 5 times with
72+
# short delays between each attempt. Fixes most transient network errors.
73+
docker_pull_attempts=0
74+
until [ "$docker_pull_attempts" -ge 5 ]
75+
do
76+
docker pull docker.elastic.co/elasticsearch/"$elasticsearch_container" && break
77+
docker_pull_attempts=$((docker_pull_attempts+1))
78+
echo "Failed to pull image, retrying in 10 seconds (retry $docker_pull_attempts/5)..."
79+
sleep 10
80+
done
81+
7082
NUMBER_OF_NODES=${NUMBER_OF_NODES-1}
7183
http_port=9200
7284
for (( i=0; i<$NUMBER_OF_NODES; i++, http_port++ )); do

docs/search-operations.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,10 @@ while (isset($response['hits']['hits']) && count($response['hits']['hits']) > 0)
283283
284284
// Execute a Scroll request and repeat
285285
$response = $client->scroll([
286+
'body' => [
286287
'scroll_id' => $scroll_id, //...using our previously obtained _scroll_id
287288
'scroll' => '30s' // and the same timeout window
288289
]
289-
);
290+
]);
290291
}
291292
----

0 commit comments

Comments
 (0)