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

Ensure we don't schedule reloading configuration when reloading is disabled #1468

Merged

Commits on Jun 7, 2024

  1. Ensure we don't schedule reloading configuration when reloading is di…

    …sabled
    
    Details of the issue as well as local reproducers are documented in 3scale#1467.
    
    This change ensures that when `boot.init_worker` checks to see whether or not
    the configuration needs to be reloaded, it also checks to confirm that the `boot.ttl()`
    value set from `APICAST_CONFIGURATION_CACHE` is a positive number, in order to avoid
    an immediate and infinite recursive loop of refreshing the configuration.
    
    This should still preserve the initial fix [1] where this regression appears to
    have been introduced, as we should never schedule reloading with the configuration settings of:
    
    ```
    APICAST_CONFIGURATION_LOADER: boot
    APICAST_CONFIGURATION_CACHE: -1
    ```
    
    We should also never have a situation where we'd need to account for `interval = 0`
    since we fail out in `boot.init` in that case [2].
    
    Tested locally as documented in the issue, however based on the comment in the initial
    fix PR, I've not added any tests in code. Happy to do so if there's now a good way
    to accomplish that!
    
    [1] 3scale#1399
    [2] https://github.com/3scale/APIcast/blob/7e7eaf6f1d584c78d999c0d09f5b65203161c402/gateway/src/apicast/configuration_loader.lua#L146-L149
    coderbydesign committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    f6ca479 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2024

  1. Update to more readable fix based on PR review feedback

    Simplifies the conditional to reload configuration based on the interval set by
    `APICAST_CONFIGURATION_CACHE`.
    
    Also conditionally sets the interval to schedule.
    coderbydesign committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    0975fd0 View commit details
    Browse the repository at this point in the history