[Fix] Add a timeout for each inotifywait to prevent eventual locks
This commit is contained in:
parent
c28172b63f
commit
48ab309698
|
@ -395,7 +395,8 @@ main() (
|
|||
|
||||
# Set right access in background after nc listen.
|
||||
(
|
||||
inotifywait --event create "$(dirname "${deployer_sock}")" --quiet --quiet
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "$(dirname "${deployer_sock}")" || true
|
||||
chmod 775 "${deployer_sock}"
|
||||
chgrp "${runner_deployer_groupname}" "${deployer_sock}"
|
||||
) &
|
||||
|
|
|
@ -240,7 +240,8 @@ main() (
|
|||
# Send request to runner.
|
||||
mkdir "${rd_pipeline_sock_dir}"
|
||||
(
|
||||
inotifywait --quiet --quiet --event create "${rd_pipeline_sock_dir}"
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "${rd_pipeline_sock_dir}" || true
|
||||
chmod 775 "${rd_pipeline_sock}"
|
||||
chgrp "${git_runner_groupname}" "${rd_pipeline_sock}"
|
||||
echo "${runner_request}" | ncat --unixsock "${runner_sock}"
|
||||
|
|
|
@ -263,7 +263,8 @@ process_request() (
|
|||
--arg v "$(make version)" \
|
||||
'{"response_sock":$s,"pkg_name":$n,"pkg_version":$v}')"
|
||||
(
|
||||
inotifywait --event create "${repo_clone}" 1>/dev/null 2>/dev/null
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "${repo_clone}" || true
|
||||
chmod 775 "${repo_clone}/runner.sock"
|
||||
chgrp "${runner_deployer_groupname}" "${repo_clone}/runner.sock"
|
||||
echo "${deployer_request}" | ncat --unixsock "${deployer_sock}"
|
||||
|
@ -489,7 +490,8 @@ main() (
|
|||
|
||||
# Set right access in background after nc listen.
|
||||
(
|
||||
inotifywait --event create "$(dirname "${runner_sock}")" --quiet --quiet
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "$(dirname "${runner_sock}")" || true
|
||||
chmod 775 "${runner_sock}"
|
||||
chgrp "${git_runner_groupname}" "${runner_sock}"
|
||||
) &
|
||||
|
|
|
@ -45,7 +45,8 @@ send_request() (
|
|||
"${deployer_bin}" --conf="${conf_file}" --errs="${errs_file}" \
|
||||
--daemon --once --verbose || return $?
|
||||
(
|
||||
inotifywait --event create --quiet --quiet "${response_sock_dir}"
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "${response_sock_dir}" || true
|
||||
echo "${request}" | ncat --unixsock "${deployer_sock}"
|
||||
) &
|
||||
return "$(ncat --listen --unixsock "${response_sock}" | jq .code)"
|
||||
|
|
|
@ -53,7 +53,8 @@ send_request() (
|
|||
return "${code}"
|
||||
fi
|
||||
(
|
||||
inotifywait --quiet --quiet --event create "${response_sock_dir}"
|
||||
inotifywait --timeout 1 --quiet --quiet \
|
||||
--event create "${response_sock_dir}" >&3
|
||||
echo "${request}" | ncat --unixsock "${runner_sock}"
|
||||
) &
|
||||
echo "done" | ncat --unixsock "${deployer_sock}"
|
||||
|
|
Loading…
Reference in New Issue