Skip to content

Commit

Permalink
fix weaver failing wps retry on unresolved network + fix weaver wps r…
Browse files Browse the repository at this point in the history
…etry going +1 index
  • Loading branch information
fmigneault committed Apr 23, 2024
1 parent 3b5548f commit e6021c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
- See changes in the [Weaver changes
file](https://github.com/crim-ca/weaver/blob/ec5f403958de21e1af27ff86da391d0d53ded5d9/CHANGES.rst?plain=1#L23-L249)

## Fixes

- Weaver: WPS retry logic on post-compose step.
- Apply `--network birdhouse_default` to the Docker `curl` image to allow HTTP requests to properly resolve
against the running services (WPS bird providers, Weave and Magpie). In some cases, this network would not
be automatically resolved.
- Fix the index used during HTTP request retry to avoid going one step over the intended retry attempts.

[2.2.0](https://github.com/bird-house/birdhouse-deploy/tree/2.2.0) (2024-04-18)
------------------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions birdhouse/components/weaver/post-docker-compose-up
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ RANDOM_NUMBER=${RANDOM:-$(tr -dc 0-9 < /dev/urandom 2>/dev/null | head -c 5)}
# To know when a docker run was started in case it hangs.
DOCKER_RUN_TAG="weaver_post_curl_$(date -Isecond | sed 's/:/_/g' | sed 's/+/p/g')_${RANDOM_NUMBER}"
curl_cmd() {
docker run --rm --name "${DOCKER_RUN_TAG}" "${WEAVER_CURL_IMAGE}" "$@"
docker run --network birdhouse_default --rm --name "${DOCKER_RUN_TAG}" "${WEAVER_CURL_IMAGE}" "$@"
}

# pull image if missing to avoid mangling output messages on first call
Expand Down Expand Up @@ -317,7 +317,7 @@ for prov in ${WEAVER_WPS_PROVIDERS}; do
if [ ${ret} -ne 0 ] || [ "${code}" -ne 201 ]; then
printf "\n%s\n" "${WARN}Failed registration of remote WPS provider [${prov}] on [${prov_url}]${retry_msg}."
printf "Error:\n%s\n" "${body}"
if [ ${retry} -gt ${total} ]; then
if [ ${retry} -ge ${total} ]; then
echo "${ERROR}Maximum retry attempts ${total} reached for WPS provider [${prov}]. Aborting."
reset_state
exit 23
Expand Down

0 comments on commit e6021c8

Please sign in to comment.