Snakeway v0.17.0
This release adds editor support for Snakeway configuration and changes some configuration settings. Read the upgrading section before you deploy.
Highlights
- Your editor can check Snakeway configuration as you type. See Editor Support.
- Services now have names.
- Snakeway no longer needs OpenSSL.
Added
- The
snakeway lspcommand for editor support. - Block labels for
servicesandwasm_devices, such asservices "api" { ... }. - A
tlsblock for Unix socket upstreams. GET /admin/reload, which shows how the last reload finished.
Changed
- Every service needs a name.
- A service's identity is now its configured name.
The
servicemetric label, the service keys in/admin/upstreamsand/admin/stats, and theservicelog field use it. Before this release, the value was the bind address with-serviceappended, such as0.0.0.0:443-service. - In WASM devices,
timeout_msis nowtimeout_milliseconds, andbody_buffer_maxis nowbody_buffer_max_bytes. - In
circuit_breaker,enable_auto_recoveryis nowenable. The setting always turned the whole circuit breaker on or off, and the new name says so. - In
GET /admin/upstreams,latency_msis nowlatency_milliseconds. - A Unix socket upstream is now written as
sock = { path = "/run/app.sock" }. - A Unix socket upstream uses TLS only when it has a
tlsblock. - A repeated key in a WASM device
configblock is now an error. - A CA file must contain only certificates.
- Upstream certificate checks are stricter. See Certificate requirements.
- Configuration errors show the line from your file where the problem is.
- A reload that changes
pid_fileorupgrade.sockis rejected. Restart Snakeway to apply those changes. - Snakeway no longer logs a "decision reason" line for every request at the default log level.
That line now appears only at
RUST_LOG=debug. At the default level, it cost about 9 percent of throughput, and a slow log destination such as a terminal could slow every request. - Two upstreams in one service with the same
endpointare now an error. - The
upstreamlabel on metrics has a new value for every upstream.
Fixed
- Two services under one
bindnow both receive traffic. - A reload now picks up manual TLS certificate files that you replaced.
- A reload now applies changes to server settings such as upstream timeouts.
This starts a new process and works only on Linux with a
pid_file. - Changes to
ca_filenow apply on reload without a restart. - A service that leaves out the
circuit_breakerblock now uses the documented defaults. Before this release, leaving the block out set every threshold to zero and stopped upstream 5xx responses from counting as failures. - The documented default for
health_check.failure_thresholdwas wrong. It is 3, not 5.health_check.enablehas no default, and you must set it whenever you write ahealth_checkblock. - The setting tables for the devices and for
connection_filtershowed default values for settings that you must set. Those settings now show as required. GET /admin/upstreamsnow reports each upstream's latency inlatency_milliseconds. Before this release, the field was namedlatency_msand was alwaysnull.- The Admin API page listed a field named
open_duration_ms. The field has always beenopen_duration_milliseconds. snakeway config checknow reports the number of upstreams. Before this release, the "upstreams" line showed the number of services.- Two upstreams in one service could get the same internal id. When that happened, one upstream received all of the traffic for both, and the two shared health and circuit breaker state. Each upstream in a service now gets its own id.
- A reload that removed or renamed a service could stop Snakeway if a request to that service was still in progress.
- With the circuit breaker off, an upstream that health checks removed stayed out of rotation until a restart.
It now returns when
unhealthy_cooldown_secondsends. - A reload that turned the circuit breaker on or off could leave an upstream out of rotation until a restart.
- Health checks now remove an upstream only after
health_check.failure_thresholdfailures in a row. Before this release, one failure removed it. - A reload no longer reads the config files twice.
Security
- An upstream with
verify = trueand no CA file now has its certificate checked. Before this release, Snakeway did not check it.
Known issues
upgrade.max_retrieshas no effect. The listener handover during a zero-drop upgrade always retries five times. A fix is open at https://github.com/cloudflare/pingora/pull/1012.
Upgrading
After you install v0.17.0, run snakeway config check on your configuration.
It reports the settings that you need to change.
- Give every service a name, with a block label or a
nameattribute. - In WASM devices, rename
timeout_mstotimeout_millisecondsandbody_buffer_maxtobody_buffer_max_bytes. - In
circuit_breaker, renameenable_auto_recoverytoenable. - Change each
sock = "/path"tosock = { path = "/path" }. If the socket uses TLS, add atlsblock. - Remove anything that is not a certificate from your CA files.
- If an upstream sets
verify = trueand uses a certificate from a private CA, setca_filefor that upstream. - If a service turns on
health_checkand leaves outcircuit_breaker, an upstream that returnshealth_check.failure_threshold5xx responses in a row now goes out of rotation until the cooldown ends. To keep the old behavior, addcircuit_breaker = { count_http_5xx_as_failure = false }to that service. - Remove any upstream that repeats the
endpointof another upstream in the same service. - Update dashboards, alerts, and admin API scripts that refer to a service by its old name.
The
servicelabel and the service keys in/admin/upstreamsand/admin/statsnow use the configured name, not<bind address>-service. Theupstreamlabel also has a new value for every upstream.