Skip to content

fix(container): retry the listing of an engine dropped at startup - #1611

Open
kokhlo wants to merge 1 commit into
falcosecurity:mainfrom
kokhlo:fix/dropped-engine-retry
Open

kokhlo wants to merge 1 commit into
falcosecurity:mainfrom
kokhlo:fix/dropped-engine-retry

Conversation

@kokhlo

@kokhlo kokhlo commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What this PR does

An engine that answered its ping but did not finish its initial listing within the engine timeout was skipped for good in bootstrapEngines: the plugin stayed blind to every container of that runtime for the rest of the run, even after the runtime recovered from its slow start.

This is the second follow-up listed in #1535. Instead of dropping the engine, the whole engine is now deferred to the fetcher, the same way a listing interrupted by the engine timeout already is (ListIncompleteError path):

  • DeferredContainers gains a RetryList marker for a group holding an engine whose listing timed out.
  • The worker hands the engine over without running it in the synchronous startup.
  • The fetcher retries its listing in the background, one bounded attempt (WithEngineTimeout) per serve iteration, re-queued at the final backoff delay while it keeps timing out.
  • Until the listing answers, the engine takes part in no on-demand lookup: its containers would miss every probe anyway.
  • Once the listing answers, its containers are published with IsCreate and its getter joins the on-demand lookups. A partial answer (ListIncompleteError) also joins the existing deferred-container recovery.

How to verify it

Unit tests, no runtime required:

cd plugins/container/go-worker
go test ./pkg/container/ -run 'TestFetcher|TestNewFetcherEngine' -v
go test . -run TestBootstrap -v
  • TestFetcherRecoversAnEngineDroppedAtStartup: the listing is held by the runtime, then answers; the containers are published and the engine serves lookups.
  • TestFetcherDroppedEngineListingRetryIsBounded: a listing that never answers keeps being retried without blocking requests.
  • TestFetcherDroppedEnginePartialListing: an answer with ListIncompleteError feeds the existing deferred recovery.
  • TestBootstrapEnginesSkipsUnresponsiveEngine: the unresponsive engine comes back as a RetryList group instead of being dropped.

On main (dbc25c5), the dropped engine never comes back: bootstrapEngines returned an empty deferred for it.

TestContainerd needs a live containerd socket and fails the same way on main in this environment.

Special notes for your reviewer

Closing the engine was the alternative discussed in #1535, but engines expose no Close; retrying the listing reuses the deferred machinery already in place for interrupted listings.

This follows #1535. cc @fedeGP

An engine that answered its ping but did not finish its initial listing
within the engine timeout was skipped for good: bootstrapEngines logged
it and moved on, so Falco stayed blind to every container of that
runtime for the rest of the run, even after the runtime recovered.

Defer the whole engine to the fetcher instead, like a listing that
returned ListIncompleteError already does. DeferredContainers gains a
RetryList marker: the worker hands the engine over without running it
in the synchronous startup, and the fetcher keeps retrying its listing
in the background, one bounded attempt per serve iteration at the final
backoff delay. Until the listing answers, the engine takes part in no
on-demand lookup, since its containers would miss every probe; once it
answers, its containers are published and its getter joins the lookups.

Follow-up of falcosecurity#1535.

Signed-off-by: Konstantin Khlopkov <konstantin.khlopkov93@gmail.com>
@poiana

poiana commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kokhlo
Once this PR has been reviewed and has the lgtm label, please assign deepskyblue86 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana

poiana commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

There is not a label identifying the kind of this issue or PR.
Please specify it either using /kind <group> or manually from the side menu.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@poiana poiana added the size/XL label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Rules files suggestions

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