Skip to content

Commit 7b470b2

Browse files
committed
Merge branch 'sync/upstream-step1' into sync/upstream-step2
2 parents 86cc69b + 3e37e17 commit 7b470b2

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎scripts/hooks/pre-commit‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ FORMATTER="${CLANG_FORMAT:-clang-format-20}"
1313
FORMAT_FILES=()
1414
while IFS= read -r file; do
1515
[ -n "$file" ] && FORMAT_FILES+=("$file")
16-
done < <(git diff --cached --name-only --diff-filter=ACMR -- '*.c' '*.h')
16+
# Vendored sources are pinned by scripts/vendored-checksums.txt and must stay
17+
# byte-identical to upstream, so they are never reformatted.
18+
done < <(git diff --cached --name-only --diff-filter=ACMR -- '*.c' '*.h' \
19+
':(exclude)internal/cbm/vendored/**' ':(exclude)vendored/**')
1720
if [ "${#FORMAT_FILES[@]}" -gt 0 ]; then
1821
command -v "$FORMATTER" >/dev/null 2>&1 || {
1922
echo "pre-commit: required formatter not found: $FORMATTER" >&2

‎src/daemon/application.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,10 @@ static int application_max_restarts(void) {
923923
return (int)v;
924924
}
925925

926+
int cbm_index_restart_cap_for_testing(void) {
927+
return application_max_restarts();
928+
}
929+
926930
static void application_attempt_init(application_attempt_t *attempt) {
927931
memset(attempt, 0, sizeof(*attempt));
928932
attempt->result.outcome = CBM_PROC_SPAWN_FAILED;

‎src/daemon/application.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ void cbm_daemon_application_set_permanent(cbm_daemon_application_t *application,
8383
/* Cancel and reap all daemon-owned operations within timeout_ms. Normal final
8484
* client shutdown calls this before watcher/store teardown. Idempotent. */
8585
bool cbm_daemon_application_shutdown(cbm_daemon_application_t *application, uint32_t timeout_ms);
86+
87+
/* CBM_INDEX_MAX_RESTARTS as the index supervisor reads it. Test hook. */
88+
int cbm_index_restart_cap_for_testing(void);
8689
/* Destroy application storage only after every borrowed callback and physical
8790
* operation is quiescent. Returns false without freeing anything when the
8891
* timeout expires; the caller must retain both the application and every

0 commit comments

Comments
 (0)