An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/cloudflare/tableflip

Package tableflip implements zero downtime upgrades. An upgrade spawns a new copy of argv[0] and passes file descriptors of used listening sockets to the new process. The old process exits once the new process signals readiness. Thus new code can use sockets allocated in the old process. This is similar to the approach used by nginx, but as a library. At any point in time there are one or two processes, with at most one of them in non-ready state. A successful upgrade fully replaces all old configuration and code. To use this library with systemd you need to use the PIDFile option in the service file. Then pass /path/to/pid-file to New. You can use systemd-run to test your implementation: systemd-run will print a unit name, which you can use with systemctl to inspect the service. NOTES: Requires at least Go 1.9, since there is a race condition on the pipes used for communication between parent and child. If you're seeing "can't start process: no such file or directory", you're probably using "go run main.go", for graceful reloads to work, you'll need use "go build main.go". Tableflip does not work on Windows, because Windows does not have the mechanisms required to support this method of graceful restarting. It is still possible to include this package in code that runs on Windows, which may be necessary in certain development circumstances, but it will not provide zero downtime upgrades when running on Windows. See the `testing` package for an example of how to use it. This shows how to use the upgrader with the graceful shutdown facilities of net/http. This shows how to use the Upgrader with a listener based service.

Ecosystem
proxy.golang.org
Latest Release
v1.2.3
almost 4 years ago
Versions
6
Dependent Packages
87
Dependent Repos
127
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/cloudflare/tableflip
spec
License BSD-3-Clause
Namespace github.com/cloudflare
First Release over 6 years ago
Last Synced about 12 hours ago
Repository
Stars 3,003 on GitHub
Forks 151 on GitHub
Docker Dependents 77
Docker Downloads 410,884,890
Commits 64
Committers 15
Avg per Author 4.267
DDS 0.375
Rankings on proxy.golang.org
Overall Top 1.0%
Dependent packages Top 0.5%
Dependent repos Top 0.5%
Forks Top 2.4%
Docker downloads Top 0.2%