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

Support dynamic zilla configuration via https #139

Closed
jfallows opened this issue Dec 21, 2022 · 2 comments · Fixed by #166
Closed

Support dynamic zilla configuration via https #139

jfallows opened this issue Dec 21, 2022 · 2 comments · Fixed by #166
Assignees
Labels
enhancement New feature or request

Comments

@jfallows
Copy link
Contributor

jfallows commented Dec 21, 2022

Retrieve initial zilla.yaml configuration via https, then detect a new configuration available at the same URL.

This can be done via infrequent GET if-none-match polling, or ideally using prefer: wait=86400 header instead, allowing the response to unwind only when the 1 day timeout expires or immediately when the content changes.

The reaction to the changed configuration will be the same as for #138 as only the https retrieval mechanism differs.

@jfallows jfallows added the enhancement New feature or request label Dec 21, 2022
@bmaidics
Copy link
Contributor

bmaidics commented Jan 4, 2023

I started looking into this.
RFC specification of the prefer header says (https://www.rfc-editor.org/rfc/rfc7240#section-4.3):

The "wait" preference can be used to establish an upper bound on the
length of time, in seconds, the client expects it will take the
server to process the request once it has been received. In the case
that generating a response will take longer than the time specified,
the server, or proxy, can choose to utilize an asynchronous
processing model by returning -- for example -- a 202 (Accepted)
response.

According to this, it's only an upper bound. So if the config on the webserver is there, it'll immediately return (Tried this with a dummy python webserver). It'd only be good for us if it'd be a lower bound as well. Or am I missing something?

@bmaidics bmaidics self-assigned this Jan 4, 2023
@jfallows
Copy link
Contributor Author

jfallows commented Jan 8, 2023

Yeah, that's correct, when prefer: wait=N is used alone.

However, when prefer: wait=N is combined with if-none-match: <etag> then we can get an immediate response when the new configuration is available, and if the upper bound is reached before then, a 304 not modified can be returned instead. Then Zilla can re-issue the request immediately to detect the configuration change.

The intention is to get the benefits of polling, but waiting at the server instead of the client for less overhead and more timely delivery. This technique is commonly referred to as long-polling.

Please see http.kafka.cache example for more details on how we support this on the server side in Zilla.

@jfallows jfallows changed the title Support dynamic zilla.json configuration via https Support dynamic zilla configuration via https Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants