github-actions[bot] commented on code in PR #68031:
URL: https://github.com/apache/doris/pull/68031#discussion_r4017855723
##########
build.sh:
##########
@@ -1330,7 +1330,10 @@ if [[ "${BUILD_FE}" -eq 1 ]]; then
# named): a new connector ships a template and needs no change here.
for conn_conf_tpl in "${conn_plugin_target}"/*.conf.template; do
[ -e "${conn_conf_tpl}" ] || continue
- cp -n "${conn_conf_tpl}" "${conn_conf_tpl%.template}"
+ # macOS cp -n returns 1 when the destination exists, which aborts
this script under set -e.
+ if [[ ! -e "${conn_conf_tpl%.template}" ]]; then
+ cp "${conn_conf_tpl}" "${conn_conf_tpl%.template}"
Review Comment:
[P2] Keep no-clobber protection at the write boundary
This pre-check is not atomic with the following copy. If `build.sh` observes
no live config and a configuration manager installs one before `cp` opens the
destination, plain `cp` truncates that newly installed administrator file,
contradicting the block's `never overwritten` contract. A deterministic check
-> install `admin` -> copy sequence preserves `admin` with the old `cp -n` but
replaces it with the template here. Please retain no-clobber behavior inside
the guard (a raced-in file may safely stop the build) or use an atomic
create-if-absent helper, and cover this interleaving in the fixture.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]