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

feat(userspace): deprecate -d daemonize option #2677

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

incertum
Copy link
Contributor

@incertum incertum commented Jul 8, 2023

Symptoms included the message queue filling up without popping any messages even though events were handled normally.

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

/kind release

Any specific area of the project related to this PR?

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

/area build

/area engine

/area tests

/area proposals

/area CI

What this PR does / why we need it:

Update : feat(userspace): deprecate -d daemonize option

@falcosecurity/falco-maintainers

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat(userspace)!: remove `-d` daemonize option

@jasondellaluce
Copy link
Contributor

/milestone 0.36.0

@poiana poiana added this to the 0.36.0 milestone Jul 10, 2023
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

@incertum Does this PR just correct the comments?

@incertum
Copy link
Contributor Author

incertum commented Aug 2, 2023

This is not wip and rather "desperation in progress" as it's just a dummy commit somehow, I have no glue really other than it's broken no outputs when using -d option. Ideas? At this point it could be anything, some other issues or just the wrong place now to exit out ...

@leogr
Copy link
Member

leogr commented Aug 11, 2023

Questions:

  • Have you tried to disable stdout and use just file?
  • Do we really need the -d option? 🤔

@incertum
Copy link
Contributor Author

Have you tried to disable stdout and use just file?

yes same outcome, that is, no outputs. My debugging journey came to the conclusion that somehow we fail to reach the code flow where we pop from the queue when using -d, something that of course makes no sense as I could confirm we got events and were putting them into the queue ...

Do we really need the -d option?

I actually synced with SREs and the answer would be no. However, we should keep the pidfile option. That was the one appealing aspect of using -d for one environment, but we already changed the deployment and don't need -d anymore anyways.

@leogr depending on how much engineering resources we have, I am of course ok with keeping it if someone finds a fix. At the same time, it would not be good to keep supporting something that is broken. In addition, removing some older features not urgently needed will be better for all of us maintainers, because we reduce maintenance overhead and make space for new features we urgently do need. Therefore, I would be ok to just remove it without a formal deprecation process since it is already broken in the current release. Again, we can keep the pidfile option without needing -d.

If above sounds like a plan I can go ahead and repurpose this PR, else I may just close it as I am not advancing with finding a fix.

@leogr
Copy link
Member

leogr commented Aug 21, 2023

Do we really need the -d option?

I actually synced with SREs and the answer would be no. However, we should keep the pidfile option. That was the one appealing aspect of using -d for one environment, but we already changed the deployment and don't need -d anymore anyways.

@leogr depending on how much engineering resources we have, I am of course ok with keeping it if someone finds a fix. At the same time, it would not be good to keep supporting something that is broken. In addition, removing some older features not urgently needed will be better for all of us maintainers, because we reduce maintenance overhead and make space for new features we urgently do need. Therefore, I would be ok to just remove it without a formal deprecation process since it is already broken in the current release. Again, we can keep the pidfile option without needing -d.

Since using systemd or Kubernetes is the default way to go, I find the -d flag somewhat redundant and, as you pointed out, potentially confusing. I actually don't see any compelling use case where that option should be used.

So, I'm in favor to remove it just because not having that option would provide a better UX, regardless of the fact that's broken. Ofc, I wouldn't fix it if we decide to remove it.

Also, I totally agree with keeping the --pidfile option without -d. Btw, it looks like we are already using --pidfile this way 👇
https://github.com/falcosecurity/falco/blob/master/scripts/systemd/falco-kmod.service

If above sounds like a plan I can go ahead and repurpose this PR, else I may just close it as I am not advancing with finding a fix.

let's see what others think cc @falcosecurity/falco-maintainers

@Andreagit97
Copy link
Member

Sorry, I'm late to the party, agree with removing this!

@poiana poiana added size/L and removed size/XS labels Aug 23, 2023
@incertum incertum changed the title fix(userspace): fix broken outputs when using -d daemonize option feat(userspace): deprecate -d daemonize option Aug 23, 2023
@incertum
Copy link
Contributor Author

Removed -d flag in case we want to follow through with the deprecation. Something else missing or did I remove it properly?

@leogr
Copy link
Member

leogr commented Aug 24, 2023

Removed -d flag in case we want to follow through with the deprecation. Something else missing or did I remove it properly?

One file is conflicting. Rebase pls. 🙏

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

All these cleanups are really appreciated, thank you!

userspace/falco/app/actions/pidfile.cpp Show resolved Hide resolved
@@ -51,7 +51,7 @@ falco::app::run_result falco::app::actions::init_outputs(falco::app::state& s)

if (s.options.dry_run)
{
falco_logger::log(LOG_DEBUG, "Skipping daemonizing in dry-run\n");
falco_logger::log(LOG_DEBUG, "Skipping outputs initialization in dry-run\n");
Copy link
Member

Choose a reason for hiding this comment

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

oh cool you have already done it here, ignore my comment in the other PR i don't remember which 😹

Andreagit97
Andreagit97 previously approved these changes Aug 25, 2023
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Aug 25, 2023

LGTM label has been added.

Git tree hash: 43f32110b12100baf0134e85f0f798f6a78a24f5

@Andreagit97
Copy link
Member

Andreagit97 commented Aug 25, 2023

we need a rebase now 🙄

Deprecate `-d` option (currently broken).

Symptoms included the message queue filling up without popping any messages
even though events were handled normally.

Maintainers decided to deprecate not needed `-d` option while keeping
the useful `pidfile` command args option.

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@poiana poiana added the lgtm label Aug 25, 2023
@poiana
Copy link
Contributor

poiana commented Aug 25, 2023

LGTM label has been added.

Git tree hash: 0ee2ac67767609a87e2f7a78b5855ac8dbbc6a97

@poiana
Copy link
Contributor

poiana commented Aug 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, incertum, 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:
  • OWNERS [Andreagit97,incertum,leogr]

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

@poiana poiana merged commit 37ea9b2 into falcosecurity:master Aug 25, 2023
@incertum incertum deleted the fix-daemonize branch March 5, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants