Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(libsinsp): correct MINIMAL_BUILD gate for docker #128

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

leogr
Copy link
Member

@leogr leogr commented Nov 12, 2021

container_engine/docker/async_source.h includes curl, which is not included in the minimal build.

Signed-off-by: Leonardo Grasso [email protected]

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area driver-kmod

/area driver-ebpf

/area libscap

/area libsinsp

/area tests

/area proposals

What this PR does / why we need it:

The issue was introduced by #66 and we noticed it when added a specific CI check (see falcosecurity/test-infra#555) for testing the minimal build of libs.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

`container_engine/docker/async_source.h` includes curl, which is not included in the minimal build.

Signed-off-by: Leonardo Grasso <[email protected]>
@poiana
Copy link
Contributor

poiana commented Nov 12, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leogr

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

The pull request process is described here

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 added the lgtm label Nov 12, 2021
@leogr leogr changed the title wip: fix(libsinsp): correct MINIMAL_BUILD gate for docker fix(libsinsp): correct MINIMAL_BUILD gate for docker Nov 12, 2021
@ldegio ldegio self-requested a review November 12, 2021 15:59
@poiana poiana merged commit 340be86 into master Nov 12, 2021
@poiana poiana deleted the fix/minimal-build-for-docker branch November 12, 2021 16:00
leogr pushed a commit to leogr/libs that referenced this pull request Jan 5, 2023
* Revert "Revert "Merge upstream pr 688 (falcosecurity#121)" (falcosecurity#122)"

This reverts commit c8dbbf3.

This adds the fix back. I'll test with an agent PR that
updates/removes the tests.

* Add the ability to "defer" an async lookup

In some cases, the "server" code running run_impl might want to retry
its work until later. The current version can't do that--once a key is
dequeued using deque_next_key, it has to call store_value or lose the
request.

To make retries easier, add a method defer_lookup that pushes the
key (and optional value) back onto the request queue with a
configurable delay. After delay, the key will be pulled again with a
call to dequeue_next_key().

Signed-off-by: Mark Stemm <[email protected]>

* Use defer_lookup for container info retry instead of lookup_delayed

When the container async lookup class wants to retry a lookup, the
current version tries to use lookup_delayed to initiate a new request.

It turns out that that doesn't work--if there's already an existing
request in m_value_map, it assumes that the "server" doing run_impl
will eventually return an answer, and doesn't add a request to the
queue.

The solution is to use the newly added lookup_delayed instead, which
pushes the request back onto the queue with a short delay.

Signed-off-by: Mark Stemm <[email protected]>

* Use a separate max_wait_ms instead of re-using s_cri_timeout

Now that timeouts are working, it may take several seconds for
subsequent retries to complete. However, s_cri_timeout (typically 1
second) was being used for the max_wait_ms in cri_async_source. That
would mean that a lookup would expire before the server side had
retried the lookup.

The solution is to use a separate 10 second max_wait_ms, which matches
docker.

Signed-off-by: Mark Stemm <[email protected]>

Signed-off-by: Mark Stemm <[email protected]>
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.

4 participants