moby/libnetwork/networkdb
Cory Snider 424ae36046 libnetwork/diagnostic: use standard http.Handler
We don't need C-style callback functions which accept a void* context
parameter: Go has closures. Drop the unnecessary httpHandlerCustom type
and refactor the diagnostic server handler functions into closures which
capture whatever context they need implicitly.

If the node leaves and rejoins a swarm, the cluster agent and its
associated NetworkDB are discarded and replaced with new instances. Upon
rejoin, the agent registers its NetworkDB instance with the diagnostic
server. These handlers would all conflict with the handlers registered
by the previous NetworkDB instance. Attempting to register a second
handler on a http.ServeMux with the same pattern will panic, which the
diagnostic server would historically deal with by ignoring the duplicate
handler registration. Consequently, the first NetworkDB instance to be
registered would "stick" to the diagnostic server for the lifetime of
the process, even after it is replaced with another instance. Improve
duplicate-handler registration such that the most recently-registered
handler for a pattern is used for all subsequent requests.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-12-06 11:19:59 -05:00
..
broadcast.go Optimize networkDB queue 2018-07-02 16:59:45 -07:00
cluster.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
delegate.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
event_delegate.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
message.go NetworkDB allow setting PacketSize 2017-07-26 13:44:33 -07:00
networkdb.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
networkdb.pb.go update generated files 2023-05-29 03:28:35 +02:00
networkdb.proto fix protos and "go generate" commands 2023-05-29 03:28:35 +02:00
networkdb_test.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
networkdbdiagnostic.go libnetwork/diagnostic: use standard http.Handler 2023-12-06 11:19:59 -05:00
nodemgmt.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
watch.go libnetwork/networkdb: NetworkDB.Watch(): remove unused "key" argument 2023-07-05 12:30:20 +02:00