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

Load VEXTs in manager #4172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nigoroll
Copy link
Member

@nigoroll nigoroll commented Sep 6, 2024

We foresaw this when we added VEXTs: while storage VEXTs have been happy with loading in the worker process, to support pluggable acceptors, VEXTs need to be present in the manager for opening privileged ports etc.

An implementation of a pluggable excceptor as a VMOD can be found in https://github.com/nigoroll/varnish-cache/commits/plugable_acceptors_rebase/, which is based upon #3976

@simonvik
Copy link
Contributor

simonvik commented Sep 6, 2024

I'm very much in favor for this change, this also allows us to define transports (like proxy) as VEXTs (without hacking too much)

@bsdphk
Copy link
Contributor

bsdphk commented Sep 9, 2024

», VEXTs need to be present in the manager for opening privileged ports etc.«

This is simply not true.

VEXT's get a chance to bite before privileges are dropped right after the fork().

@nigoroll
Copy link
Member Author

nigoroll commented Sep 9, 2024

bugwash: I apologized for my mistake on the privileges, I probably had too much in mind what the solaris jail does, and need to look again at the privilege separation stuff.
Other than that, if vexts can't be loaded before -a processing, they need a different way to configure

we foresaw this when we added VEXTs: while storage VEXTs have been happy with
loading in the worker process *), to support pluggable acceptors, VEXTs need to
be present in the manager for opening privileged ports etc.

*) There are two reasons why restricting VEXTs to the child worked for the
   (only?) existing storage VEXT: It does not insist on creating the storage
   file with elevated privileges, and, as far as VCL is concerned, the storage
   gets configured even if its code is not yet present (See STV_Config())
... to enable acceptor implementations as extensions (and also allow storage to
make use of manager privileges, but for this we probably need a new or
repurposed STV callback).

One test adjustment was required:

c3.vtc tests invalid -a usage, but did not set up a good working directory. Now
that -a is processed later, the test ran into a working directory error instead
of the expected acceptor error.
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