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

varnishd command line syntax for pluggable acceptors? #4169

Open
nigoroll opened this issue Sep 5, 2024 · 2 comments
Open

varnishd command line syntax for pluggable acceptors? #4169

nigoroll opened this issue Sep 5, 2024 · 2 comments

Comments

@nigoroll
Copy link
Member

nigoroll commented Sep 5, 2024

Working on a continuation of #3976 the question arose which command line syntax we want for pluggable acceptors. I see two basic options:

  • backwards compatible -a
  -a [name=][kind,][listen_address[,PROTO|,option=value,...]]

here, kind would be the acceptor kind, so a valid use case would be -a foo=tcp,127.0.0.1:4444

  • new, additional argument, for example -A, where kind is mandatory
  -a [name=]kind[,listen_address[,PROTO|,option=value,...]]

I like to avoid adding new options, but the first option comes with some ambiguity:

foo,bar

could mean

kind=foo, listen_address=bar

or

listen_address=foo, PROTO=bar

and, because of backwards compatibility, the error message might be confusing:

$ /tmp/sbin/varnishd -a foo=xxx,@foo -b @A -n /tmp/t
Error: Unknown protocol '@foo'

This can be tried out here: nigoroll@fe32476

@nigoroll
Copy link
Member Author

nigoroll commented Sep 9, 2024

bugwash: phk is for not adding -a processing for VEXTs. He suggests a varnish.cf file which would allow for per-extension acceptors (which I appreciate!) and we would probably also need some -Eext.so,-a=...,-a=... or similar.

I still think that using -E to load extensions and then use a consistent -a and -s across all implementations is cleaner and would still prefer that.

nigoroll added a commit to nigoroll/varnish-cache that referenced this issue Nov 3, 2024
We add [%kind,] to the acceptor command line options to select the acceptor
implementation. The syntax is now:

	[name=][%<kind>,][listen_address[,PROTO|,option=value,...]]

Reasons are explained in varnishcache#4169
@nigoroll
Copy link
Member Author

nigoroll commented Nov 3, 2024

I've settled on suggesting

[name=][%<kind>,][listen_address[,PROTO|,option=value,...]]

now. Reasons:

  • % is never the first character of a valid hostname for listen_address
  • % is highly unlikely as the first character of a unix domain socket
  • and if it is really intended as such, %uds,%path can be used

I did look at other alternatives, such as:

  • [name=][kind=<kind>,][listen_address[,PROTO|,option=value,...]] is ambiguous again
  • [name=][listen_address[,PROTO|,option=value,...]][,kind=<kind>] is bad because the option part should belong to the implementation

The implementation has been added to #4172 because plugging an acceptor is the basis for the test of this option.

nigoroll added a commit to nigoroll/varnish-cache that referenced this issue Nov 9, 2024
We add [%kind,] to the acceptor command line options to select the acceptor
implementation. The syntax is now:

	[name=][%<kind>,][listen_address[,PROTO|,option=value,...]]

Reasons are explained in varnishcache#4169
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

No branches or pull requests

1 participant