Skip to content

Commit 39c9f0f

Browse files
committed
Trigger CI
1 parent dc76d1f commit 39c9f0f

2 files changed

Lines changed: 23 additions & 21 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ jobs:
269269
needs: setup
270270
if: needs.setup.outputs.packages-count != '0'
271271
runs-on: ubuntu-latest
272-
timeout-minutes: 720
273272
env:
274273
PACKAGES: ${{ needs.setup.outputs.packages }}
275274
CRASHTRACKER_FEATURE: ${{ needs.setup.outputs.crashtracker-feature }}
@@ -298,7 +297,7 @@ jobs:
298297
cache-bin: true # cache the ~/.cargo/bin directory
299298
- name: Build CentOS 7 Docker image
300299
run: docker build -t libdatadog-centos7 -f tools/docker/Dockerfile.centos .
301-
- name: "cargo nextest run (centos7) x100"
300+
- name: "cargo nextest run (centos7)"
302301
# Run docker as a user, not the default root
303302
# Mount and use the runner's toolchain as it's the same arch
304303
# exclude tracing integration tests since they require docker in docker to run a test-agent
@@ -311,20 +310,17 @@ jobs:
311310
# shellcheck disable=SC2086
312311
NEXTEST_CMD="cargo nextest run $PACKAGES $CRASHTRACKER_FEATURE --profile ci --no-tests=pass -E '!test(tracing_integration_tests::)'"
313312
fi
314-
for i in $(seq 1 100); do
315-
echo "=== Run $i/100 ==="
316-
docker run --rm \
317-
--user "$(id -u):$(id -g)" \
318-
-v "${{ github.workspace }}:/workspace" \
319-
-v "${CARGO_HOME:-$HOME/.cargo}:/usr/local/cargo" \
320-
-v "${RUSTUP_HOME:-$HOME/.rustup}:/usr/local/rustup" \
321-
-e CARGO_HOME=/usr/local/cargo \
322-
-e RUSTUP_HOME=/usr/local/rustup \
323-
-e PATH=/usr/local/cargo/bin:/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:/opt/rh/devtoolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
324-
-w /workspace \
325-
libdatadog-centos7 \
326-
sh -c "$NEXTEST_CMD"
327-
done
313+
docker run --rm \
314+
--user "$(id -u):$(id -g)" \
315+
-v "${{ github.workspace }}:/workspace" \
316+
-v "${CARGO_HOME:-$HOME/.cargo}:/usr/local/cargo" \
317+
-v "${RUSTUP_HOME:-$HOME/.rustup}:/usr/local/rustup" \
318+
-e CARGO_HOME=/usr/local/cargo \
319+
-e RUSTUP_HOME=/usr/local/rustup \
320+
-e PATH=/usr/local/cargo/bin:/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:/opt/rh/devtoolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
321+
-w /workspace \
322+
libdatadog-centos7 \
323+
sh -c "$NEXTEST_CMD"
328324
- name: Add file attributes to JUnit XML
329325
if: success() || failure()
330326
run: cargo run --bin add_junit_file_attributes -- target/nextest/ci/junit.xml

libdd-crashtracker/src/receiver/ptrace_collector.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,12 @@ fn is_transient_ptrace_error(err: &PtraceError) -> bool {
408408

409409
/// Attempt to capture a thread context, retrying once on transient failures.
410410
///
411-
/// Uses a single per-thread deadline across attempts so that a slow thread
412-
/// cannot consume more than STOP_TIMEOUT_PER_THREAD total.
411+
/// Each attempt gets its own `STOP_TIMEOUT_PER_THREAD` budget (capped at the
412+
/// overall deadline) so that a retry after a timeout-induced failure actually
413+
/// has enough time to succeed. On older kernels (e.g. CentOS 7 / kernel 3.10)
414+
/// the first attempt can consume its entire budget waiting for registers to
415+
/// become readable; reusing that exhausted deadline would make the retry a
416+
/// no-op.
413417
///
414418
/// A capture that succeeds but produces zero frames is also retried: on a
415419
/// running thread with a confirmed non-zero IP, empty frames indicates a
@@ -435,13 +439,15 @@ fn capture_with_retry(
435439
return None;
436440
}
437441

438-
let remaining = thread_deadline.saturating_duration_since(Instant::now());
439-
if remaining <= RETRY_DELAY {
442+
if Instant::now() + RETRY_DELAY >= overall_deadline {
440443
return None;
441444
}
442445
std::thread::sleep(RETRY_DELAY);
443446

444-
capture_thread_context(tid, resolve_frames, addr_space, thread_deadline).ok()
447+
// Give the retry a fresh per-thread budget so it has a real chance of
448+
// succeeding even if the first attempt consumed its entire deadline.
449+
let retry_deadline = (Instant::now() + STOP_TIMEOUT_PER_THREAD).min(overall_deadline);
450+
capture_thread_context(tid, resolve_frames, addr_space, retry_deadline).ok()
445451
}
446452

447453
/// Stream thread contexts to a callback one at a time.

0 commit comments

Comments
 (0)