Skip to content

feat(docs): improve docs throughout collector#3604

Open
Stringy wants to merge 1 commit into
masterfrom
giles/docs-for-agents
Open

feat(docs): improve docs throughout collector#3604
Stringy wants to merge 1 commit into
masterfrom
giles/docs-for-agents

Conversation

@Stringy

@Stringy Stringy commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

A detailed explanation of the changes in your PR.

Feel free to remove this section if it is overkill for your PR, and the title of your PR is sufficiently descriptive.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why you did not do so. (Valid reasons include "CI is sufficient" or "No testable changes")
In addition to reviewing your code, reviewers must also review your testing instructions, and make sure they are sufficient.

For more details, ref the Confluence page about this section.

@codecov-commenter

codecov-commenter commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.34%. Comparing base (12b225b) to head (dda0b08).
⚠️ Report is 16 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3604   +/-   ##
=======================================
  Coverage   27.34%   27.34%           
=======================================
  Files          95       95           
  Lines        5420     5420           
  Branches     2545     2545           
=======================================
  Hits         1482     1482           
  Misses       3211     3211           
  Partials      727      727           
Flag Coverage Δ
collector-unit-tests 27.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Corrected self-check listener readiness detection to monitor the actual listening socket.
  • Documentation

    • Expanded documentation across build, deployment, runtime behavior, configuration reloads, networking, process tracking, health checks, and integration testing.
    • Clarified container health-check behavior, service lifecycle, supported runtimes, and event-tracking expectations.
  • Refactor

    • Reorganized build configuration comments without changing existing build settings.

Walkthrough

The change expands documentation across build files, collector runtime components, container packaging, and integration tests. It also adds explicit z, ssl, crypto, and bpf linkage for collector_lib; existing runtime logic and public signatures remain unchanged.

Changes

Collector documentation and build configuration

Layer / File(s) Summary
Build and container configuration
CMakeLists.txt, Makefile, collector/CMakeLists.txt, collector/lib/CMakeLists.txt, collector/container/*
Documents build targets, compiler and sinsp settings, container stages, readiness checks, and runtime ports; explicitly links collector_lib with compression, TLS, crypto, and libbpf libraries.
Runtime lifecycle and host configuration
collector/collector.cpp, collector/lib/CollectorService.*, collector/lib/ConfigLoader.h, collector/lib/Host*, collector/lib/Inotify.h, collector/lib/ProtoAllocator.h
Documents startup signal handling, configuration reloads, host heuristics, service teardown, and protobuf arena behavior.
Network and state component contracts
collector/lib/ConnTracker.*, collector/lib/Network*, collector/lib/NRadix.h, collector/lib/ProcfsScraper.h, collector/lib/RateLimit.h, collector/lib/ProcessSignalHandler.cpp
Clarifies connection state encoding, network event tracking, endpoint conversion, procfs backfilling, radix-tree synchronization, and rate-limiter semantics.
Event pipeline and startup self-checks
collector/lib/SelfCheck*, collector/lib/SignalHandler.h, collector/lib/StoppableThread.h, collector/lib/system-inspector/*, collector/self-checks.cpp
Documents handler dispatch, self-check matching and removal, sinsp filtering, event ordering, cancellation, and standalone self-check execution.
Integration test and runtime abstractions
integration-tests/pkg/*, integration-tests/suites/*
Documents runtime abstraction selection, mock-sensor ring buffering, collector readiness checks, and suite-specific connection, endpoint, procfs, reload, afterglow, and thread-tracking behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: erthalion

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is just the default template and lacks a real summary, checklist completion, and testing details. Replace the template text with a concrete PR summary, complete the checklist, and describe what testing was performed or why none was needed.
Docstring Coverage ⚠️ Warning Docstring coverage is 49.06% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change theme: documentation updates across the collector, though it understates that integration-test docs are included too.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch giles/docs-for-agents

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 15

🧹 Nitpick comments (1)
integration-tests/pkg/collector/collector.go (1)

7-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document Mounts semantics or narrow the claim.

The comment says Mounts, Env, and Config follow different code paths, but only explains Env and Config. Add the host/container path semantics for Mounts, or remove it from that claim.

As per path instructions: focus on major issues impacting performance, readability, maintainability and security; avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration-tests/pkg/collector/collector.go` around lines 7 - 17, Update the
StartupOptions documentation to explain that Mounts maps host paths to container
paths, or remove Mounts from the statement about settings following different
code paths. Keep the existing Env and Config semantics documented.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@collector/CMakeLists.txt`:
- Around line 117-122: Reword the comments around BUILD_SHARED_LIBS and
LIBELF_LIB_SUFFIX to state that project libraries default to static linkage
while required shared runtime dependencies remain supported, avoiding any
implication that the binary is fully static. Update the BUILD_SHARED_LIBS cache
help text to describe static/shared linkage rather than position-independent
code.

In `@collector/container/Dockerfile`:
- Around line 48-50: Update the Dockerfile comment above the COPY command to
describe self-checks only as a separate startup-validation executable, removing
the claim that it is independent from the full collector dependency tree. Do not
change the executable or copy behavior unless the link graph is intentionally
updated elsewhere.

In `@collector/lib/ConfigLoader.h`:
- Around line 180-185: Update the documentation comment above WatchFile to
describe the watchers as up to three categories rather than stating that all
three are always maintained. Clarify that LOADER_CONFIG_FILE is created only
when the file exists and LOADER_CONFIG_REALPATH only applies to symlink targets,
while retaining the existing category descriptions.

In `@collector/lib/HostHeuristics.cpp`:
- Around line 76-77: Update the comment near the Power heuristic condition to
describe the actual predicate: ppc64le systems running kernel 4.18 builds below
477. Do not imply RHEL 8.6-specific validation unless the implementation is also
changed to verify the distribution.

In `@collector/lib/NetworkSignalHandler.cpp`:
- Around line 15-18: Update the comment describing Modifier::ADD near
HandleSignal to state that events add or refresh tracked connections, while the
removal case handles closed sockets. Keep the explanation that this enum drives
HandleSignal’s decision without implying ADD only represents newly established
connections.

In `@collector/lib/NetworkStatusNotifier.h`:
- Around line 26-27: Update the class documentation comment in
NetworkStatusNotifier to state that arena allocation occurs only when
USE_PROTO_ARENAS is enabled, and that HeapProtoAllocator is used otherwise. Keep
the documentation aligned with the existing ProtoAllocator alias behavior.
- Around line 22-24: Update NetworkStatusNotifier::OnRecvControlMessage() so the
branch calling ReceivePublicIPs() checks the public-IP field’s presence, not
has_ip_networks(). Keep the ReceiveIPNetworks() branch guarded by the network
field and preserve the existing handling for messages containing either or both
fields.

In `@collector/lib/RateLimit.h`:
- Around line 9-14: Clarify the `TokenBucket::last_time` member comment to
consistently describe its actual timestamp semantics, matching how refill
calculations use it. Remove the conflicting elapsed-time wording while
preserving the existing `TokenBucket` fields and units.

In `@collector/lib/SelfCheckHandler.h`:
- Around line 19-25: The self-check documentation overstates verification and
startup failure behavior. In collector/lib/SelfCheckHandler.h lines 19-25,
describe the guarantee as matching events reaching the collector rather than
proving the full event pipeline; in collector/self-checks.cpp lines 12-20,
remove or qualify the statement that startup aborts so it reflects the timeout
path logging a warning and returning FINISHED.

In `@collector/self-checks.cpp`:
- Around line 57-60: Update the select() call in the listener self-check to pass
listener + 1 instead of 1, ensuring the listener descriptor is monitored.
Preserve the existing FD_ISSET(listener, &sockets) validation before calling
accept().

In `@integration-tests/pkg/collector/collector.go`:
- Around line 21-23: Update documentation at
integration-tests/pkg/collector/collector.go:21-23 to describe Kubernetes
support as future unless an implementation exists; revise the New documentation
at integration-tests/pkg/collector/collector.go:35-37 to state that it returns
the default manager and delegates execution to the supplied executor; align
integration-tests/suites/base.go:40-48 with current Docker/Podman/CRI support,
explicitly marking Kubernetes as future if mentioned.

In `@integration-tests/pkg/executor/executor.go`:
- Around line 75-77: Update New to explicitly accept only the supported runtime
commands "docker", "podman", and the intended CRI values; return an error for
any unknown or misspelled command instead of routing it to newCriExecutor.
Preserve the existing executor selection for valid runtimes.

In `@integration-tests/pkg/mock_sensor/ring.go`:
- Around line 3-7: The ring buffer implementation around RingChan must make both
oldest-value eviction and new-value enqueue non-blocking, including the gap
between detecting a full output channel and removing an item; update its
send/receive operations accordingly. In
integration-tests/pkg/mock_sensor/server.go lines 62-64, revise the channel
comments to claim blocking prevention only under the ring’s corrected
non-blocking behavior.

In `@integration-tests/pkg/mock_sensor/server.go`:
- Around line 28-31: Update the comment above gDefaultRingSize to describe 32
slots as buffering typical event bursts between scrape intervals, and explicitly
state that older values may be dropped when the ring reaches capacity; do not
claim the buffer prevents drops.

In `@integration-tests/suites/async_connections.go`:
- Around line 74-76: Correct the comment and test setup around the unreachable
address in the async connection test: do not describe 10.255.255.1 as RFC 5737
documentation space. Replace it with a reliably blackholed route/firewall-based
simulation, or explicitly document the environment-specific assumption if
retaining the address.

---

Nitpick comments:
In `@integration-tests/pkg/collector/collector.go`:
- Around line 7-17: Update the StartupOptions documentation to explain that
Mounts maps host paths to container paths, or remove Mounts from the statement
about settings following different code paths. Keep the existing Env and Config
semantics documented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: dcddd241-e848-4423-a697-74504ba61116

📥 Commits

Reviewing files that changed from the base of the PR and between 8f3e7de and edda8fe.

📒 Files selected for processing (48)
  • CMakeLists.txt
  • Makefile
  • collector/CMakeLists.txt
  • collector/collector.cpp
  • collector/container/Dockerfile
  • collector/container/status-check.sh
  • collector/lib/CMakeLists.txt
  • collector/lib/CollectorService.cpp
  • collector/lib/CollectorService.h
  • collector/lib/ConfigLoader.h
  • collector/lib/ConnTracker.cpp
  • collector/lib/ConnTracker.h
  • collector/lib/DuplexGRPC.h
  • collector/lib/ExternalIPsConfig.h
  • collector/lib/HostHeuristics.cpp
  • collector/lib/HostHeuristics.h
  • collector/lib/HostInfo.h
  • collector/lib/Inotify.h
  • collector/lib/NRadix.h
  • collector/lib/NetworkConnection.h
  • collector/lib/NetworkSignalHandler.cpp
  • collector/lib/NetworkSignalHandler.h
  • collector/lib/NetworkStatusNotifier.cpp
  • collector/lib/NetworkStatusNotifier.h
  • collector/lib/ProcessSignalHandler.cpp
  • collector/lib/ProcfsScraper.h
  • collector/lib/ProtoAllocator.h
  • collector/lib/RateLimit.h
  • collector/lib/SelfCheckHandler.cpp
  • collector/lib/SelfCheckHandler.h
  • collector/lib/SignalHandler.h
  • collector/lib/StoppableThread.h
  • collector/lib/system-inspector/Service.cpp
  • collector/lib/system-inspector/Service.h
  • collector/self-checks.cpp
  • integration-tests/pkg/collector/collector.go
  • integration-tests/pkg/executor/executor.go
  • integration-tests/pkg/mock_sensor/ring.go
  • integration-tests/pkg/mock_sensor/server.go
  • integration-tests/suites/async_connections.go
  • integration-tests/suites/base.go
  • integration-tests/suites/connections_and_endpoints.go
  • integration-tests/suites/listening_ports.go
  • integration-tests/suites/processes_and_endpoints.go
  • integration-tests/suites/procfs_scraper.go
  • integration-tests/suites/repeated_network_flow.go
  • integration-tests/suites/runtime_config_file.go
  • integration-tests/suites/threads.go

Comment thread collector/CMakeLists.txt Outdated
Comment on lines 117 to 122
# Collector ships as a statically-linked binary in a minimal UBI-micro
# container — dynamic linking would require shipping .so files.
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build position independent libraries and executables" FORCE)
# Exception to static linking: libbpf dlopen()s libelf at runtime to parse
# BPF ELF objects, so libelf must remain a shared library.
set(LIBELF_LIB_SUFFIX ".so" CACHE STRING "Use libelf.so" FORCE)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/sh
set -eu
rg -n 'BUILD_SHARED_LIBS|LIBELF_LIB_SUFFIX|target_link_libraries|dnf install|libstdc\+\+|openssl|tbb' \
  collector/CMakeLists.txt collector/lib/CMakeLists.txt collector/container/Dockerfile

Repository: stackrox/collector

Length of output: 1860


🏁 Script executed:

#!/bin/sh
set -eu

sed -n '108,126p' collector/CMakeLists.txt
printf '\n---\n'
sed -n '1,40p' collector/container/Dockerfile

Repository: stackrox/collector

Length of output: 3098


Reword this to avoid implying a fully static binary. BUILD_SHARED_LIBS only changes the default for project libraries; the image still ships shared runtime deps like libstdc++, openssl, tbb, and libelf remains shared. The cache help text should also describe static/shared linkage, not position-independent code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@collector/CMakeLists.txt` around lines 117 - 122, Reword the comments around
BUILD_SHARED_LIBS and LIBELF_LIB_SUFFIX to state that project libraries default
to static linkage while required shared runtime dependencies remain supported,
avoiding any implication that the binary is fully static. Update the
BUILD_SHARED_LIBS cache help text to describe static/shared linkage rather than
position-independent code.

Source: Path instructions

Comment thread collector/container/Dockerfile Outdated
Comment thread collector/lib/ConfigLoader.h Outdated
Comment thread collector/lib/HostHeuristics.cpp Outdated
Comment thread collector/lib/NetworkSignalHandler.cpp Outdated
Comment thread integration-tests/pkg/collector/collector.go
Comment on lines +75 to +77
// New creates the appropriate executor based on the configured container
// runtime. Docker and Podman use the Docker-compatible API client, while
// CRI (containerd, crio) uses the CRI gRPC API directly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/sh
rg -n -C 3 'RuntimeInfo\(\)|Command.*(docker|podman|containerd|crio)|newCriExecutor' .

Repository: stackrox/collector

Length of output: 3986


🏁 Script executed:

#!/bin/sh
set -e

printf '\n## integration-tests/pkg/config/config.go\n'
sed -n '1,220p' integration-tests/pkg/config/config.go

printf '\n## integration-tests/pkg/executor/executor.go\n'
sed -n '1,140p' integration-tests/pkg/executor/executor.go

printf '\n## all references to runtime command values\n'
rg -n 'runtimeDefaultCommand|envRuntimeCommand|Command:|RuntimeInfo\(\)\.Command|== "docker"|== "podman"|containerd|crio' integration-tests/pkg

Repository: stackrox/collector

Length of output: 8346


Reject unsupported runtime commands. New() sends any value other than "docker" or "podman" to newCriExecutor(), so typos or unexpected RUNTIME_COMMAND values silently fall into the CRI path. Return an error for unknown values, or make the fallback explicit in the docs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration-tests/pkg/executor/executor.go` around lines 75 - 77, Update New
to explicitly accept only the supported runtime commands "docker", "podman", and
the intended CRI values; return an error for any unknown or misspelled command
instead of routing it to newCriExecutor. Preserve the existing executor
selection for valid runtimes.

Source: Path instructions

Comment thread integration-tests/pkg/mock_sensor/ring.go Outdated
Comment thread integration-tests/pkg/mock_sensor/server.go
Comment thread integration-tests/suites/async_connections.go Outdated
@Stringy
Stringy marked this pull request as ready for review July 23, 2026 09:26
@Stringy
Stringy requested a review from a team as a code owner July 23, 2026 09:26
@Stringy
Stringy force-pushed the giles/docs-for-agents branch from bdea962 to dda0b08 Compare July 27, 2026 11:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration-tests/suites/async_connections.go`:
- Around line 74-77: Replace the hard-coded RFC1918 destination used by the
stalled-connect test with a deterministic blackhole setup, such as an isolated
route or firewall rule that guarantees SYN packets remain unanswered. If
retaining the address-based approach, add an explicit precondition check that
confirms the destination is unroutable before running the timeout assertions;
update the affected async connection test setup rather than only its comments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d6444d5e-946b-4063-a6f4-aadc69beef4d

📥 Commits

Reviewing files that changed from the base of the PR and between bdea962 and dda0b08.

📒 Files selected for processing (48)
  • CMakeLists.txt
  • Makefile
  • collector/CMakeLists.txt
  • collector/collector.cpp
  • collector/container/Dockerfile
  • collector/container/status-check.sh
  • collector/lib/CMakeLists.txt
  • collector/lib/CollectorService.cpp
  • collector/lib/CollectorService.h
  • collector/lib/ConfigLoader.h
  • collector/lib/ConnTracker.cpp
  • collector/lib/ConnTracker.h
  • collector/lib/DuplexGRPC.h
  • collector/lib/ExternalIPsConfig.h
  • collector/lib/HostHeuristics.cpp
  • collector/lib/HostHeuristics.h
  • collector/lib/HostInfo.h
  • collector/lib/Inotify.h
  • collector/lib/NRadix.h
  • collector/lib/NetworkConnection.h
  • collector/lib/NetworkSignalHandler.cpp
  • collector/lib/NetworkSignalHandler.h
  • collector/lib/NetworkStatusNotifier.cpp
  • collector/lib/NetworkStatusNotifier.h
  • collector/lib/ProcessSignalHandler.cpp
  • collector/lib/ProcfsScraper.h
  • collector/lib/ProtoAllocator.h
  • collector/lib/RateLimit.h
  • collector/lib/SelfCheckHandler.cpp
  • collector/lib/SelfCheckHandler.h
  • collector/lib/SignalHandler.h
  • collector/lib/StoppableThread.h
  • collector/lib/system-inspector/Service.cpp
  • collector/lib/system-inspector/Service.h
  • collector/self-checks.cpp
  • integration-tests/pkg/collector/collector.go
  • integration-tests/pkg/executor/executor.go
  • integration-tests/pkg/mock_sensor/ring.go
  • integration-tests/pkg/mock_sensor/server.go
  • integration-tests/suites/async_connections.go
  • integration-tests/suites/base.go
  • integration-tests/suites/connections_and_endpoints.go
  • integration-tests/suites/listening_ports.go
  • integration-tests/suites/processes_and_endpoints.go
  • integration-tests/suites/procfs_scraper.go
  • integration-tests/suites/repeated_network_flow.go
  • integration-tests/suites/runtime_config_file.go
  • integration-tests/suites/threads.go
🚧 Files skipped from review as they are similar to previous changes (45)
  • collector/lib/SignalHandler.h
  • integration-tests/pkg/mock_sensor/ring.go
  • collector/lib/StoppableThread.h
  • integration-tests/suites/connections_and_endpoints.go
  • collector/container/status-check.sh
  • collector/lib/HostHeuristics.h
  • CMakeLists.txt
  • integration-tests/suites/procfs_scraper.go
  • collector/lib/CollectorService.h
  • integration-tests/suites/processes_and_endpoints.go
  • collector/lib/NetworkStatusNotifier.cpp
  • collector/lib/ConfigLoader.h
  • collector/lib/DuplexGRPC.h
  • collector/lib/Inotify.h
  • collector/lib/NetworkSignalHandler.h
  • collector/lib/ConnTracker.h
  • collector/lib/NetworkConnection.h
  • collector/lib/ExternalIPsConfig.h
  • collector/lib/SelfCheckHandler.h
  • Makefile
  • integration-tests/pkg/executor/executor.go
  • collector/lib/HostInfo.h
  • collector/lib/NetworkStatusNotifier.h
  • integration-tests/suites/listening_ports.go
  • collector/self-checks.cpp
  • collector/lib/NetworkSignalHandler.cpp
  • collector/lib/system-inspector/Service.cpp
  • collector/lib/NRadix.h
  • integration-tests/pkg/mock_sensor/server.go
  • collector/lib/CollectorService.cpp
  • integration-tests/suites/threads.go
  • collector/lib/ProtoAllocator.h
  • integration-tests/pkg/collector/collector.go
  • collector/lib/CMakeLists.txt
  • integration-tests/suites/repeated_network_flow.go
  • integration-tests/suites/base.go
  • collector/lib/RateLimit.h
  • integration-tests/suites/runtime_config_file.go
  • collector/lib/ConnTracker.cpp
  • collector/lib/ProcfsScraper.h
  • collector/CMakeLists.txt
  • collector/lib/SelfCheckHandler.cpp
  • collector/lib/system-inspector/Service.h
  • collector/collector.cpp
  • collector/lib/HostHeuristics.cpp

Comment on lines +74 to +77
// RFC 1918 private address with no listener — expected to be
// non-routable in the test environment, so the kernel's connect()
// will hang in SYN_SENT until it times out, simulating a
// firewall-blocked connection.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major

Use a deterministic blackhole for the stalled-connect test.

This wording fixes the RFC5737 mistake, but 10.255.255.1 is not guaranteed to be unroutable from every container/CI network. If a route exists, the connection may receive an immediate RST instead of remaining in SYN_SENT, so the test can silently validate the wrong scenario. Use a controlled blackhole route/firewall rule, or verify this network assumption before relying on it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration-tests/suites/async_connections.go` around lines 74 - 77, Replace
the hard-coded RFC1918 destination used by the stalled-connect test with a
deterministic blackhole setup, such as an isolated route or firewall rule that
guarantees SYN packets remain unanswered. If retaining the address-based
approach, add an explicit precondition check that confirms the destination is
unroutable before running the timeout assertions; update the affected async
connection test setup rather than only its comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants