Skip to content

ci, test: kill all dangling descendant processes - #34963

Closed
rkrux wants to merge 1 commit into
bitcoin:masterfrom
rkrux:ci-ancestor-commits
Closed

rkrux wants to merge 1 commit into
bitcoin:masterfrom
rkrux:ci-ancestor-commits

Conversation

@rkrux

@rkrux rkrux commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

Relates to #34731

This patch kills any and all dangling descendant processes started
by the test runner in the test ancestor commits CI job only because
this job uses the --failfast option to run tests that might leave
dangling subprocesses that were not killed intentionally
in the CI because the original implementation killed the test
runner as well, which was not desirable.

@DrahtBot

DrahtBot commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34547 (lint: modernise lint tooling by willcl-ark)
  • #31723 (qa: Facilitate debugging bitcoind inside functional tests by hodlinator)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@rkrux

rkrux commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Huh! Failed at the 113th commit: https://github.com/bitcoin/bitcoin/actions/runs/23785411040/job/69307375322?pr=34963 in the opportunistic test.

So the issue was only delayed (not removed) by reusing the sockets that are under time-wait state.

@rkrux
rkrux force-pushed the ci-ancestor-commits branch from 27c73eb to db46a60 Compare April 1, 2026 09:11
@DrahtBot DrahtBot removed the CI failed label Apr 1, 2026
@rkrux

rkrux commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

Adding a 1s delay between commits and setting tcp_tw_reuse passes the ancestor commits job: https://github.com/bitcoin/bitcoin/actions/runs/23841150308/job/69496837047?pr=34963

@rkrux

rkrux commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

@rkrux

rkrux commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor Author

@rkrux

rkrux commented Apr 4, 2026

Copy link
Copy Markdown
Contributor Author

@rkrux
rkrux force-pushed the ci-ancestor-commits branch 2 times, most recently from ce5f8de to 083a715 Compare April 4, 2026 09:52
@rkrux

rkrux commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor Author

So the latest patch that kills all dangling subprocesses in this CI job has passed twice for 2-3 commits.

I will try once with ~125 commits but even if it doesn't pass, I believe it's still a good addition to kill any dangling processes in the CI.

@rkrux
rkrux force-pushed the ci-ancestor-commits branch from 083a715 to 767f77b Compare April 4, 2026 10:10
@rkrux rkrux changed the title [draft, wip, ignore] CI ci, test: kill all dangling descendant processes Apr 4, 2026
@DrahtBot DrahtBot changed the title ci, test: kill all dangling descendant processes ci, test: kill all dangling descendant processes Apr 4, 2026
@rkrux
rkrux marked this pull request as ready for review April 4, 2026 10:12
@rkrux

rkrux commented Apr 4, 2026

Copy link
Copy Markdown
Contributor Author

I guess this can be done for all CI jobs as well, later?
That way we can get rid of the conditional import as well in the test runner.

@rkrux

rkrux commented Apr 4, 2026

Copy link
Copy Markdown
Contributor Author

This patch kills any and all dangling descendant processes started
by the test runner in the test ancestor commits CI job only because
this job uses the --failfast option to run tests that might leave
dangling subprocesses that were not killed intentionally
in the CI because the original implementation killed the test
runner as well, which was not desirable.
Comment thread .github/workflows/ci.yml
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' || 'ubuntu-24.04' }}
env:
TEST_RUNNER_PORT_MIN: "14000" # Use a larger port, to avoid colliding with CIRRUS_CACHE_HOST port 12321.
CI_FAILFAST_TEST_LEAVE_DANGLING: 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand this change. Why is this set to 0?

It should either be left as-is, or set to 1, see also:

.github/workflows/ci.yml:  CI_FAILFAST_TEST_LEAVE_DANGLING: 1  # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set it to 0 because otherwise 1 would be inherited in this job, which I didn't want because I want to kill all dangling sub-processes except the CI script itself.

setting this variable avoids killing the CI script itself on error

The implementation in this PR should not kill the CI script unlike the older implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea for this PR came from this comment: #34726 (comment)

2026-03-18T02:28:12.5942751Z WARNING! There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!

I don't know why this happened but it seemed reasonable to kill any dangling process.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I understand what the code change does, but I don't understand why the change is needed and what this will even change. IIUC it will only stylistically change the CI log on GHA, but I am not even sure about that.

I don't think the code should be changed, when there is no reason, nor a description of the observed behavior change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this happened but it seemed reasonable to kill any dangling process.

I disagree, because I fail to see how killing dangling processes after a failure will affect anything that happens before a passing run. There is no connection, and if there was one, it is the burden of the pull request author to explain it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point.

I will close this PR in this case.

@rkrux rkrux closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants