Skip to content

Reload notification webhooks without restarting SILO - #249

Open
mrjavadseydi wants to merge 6 commits into
pgsty:mainfrom
mrjavadseydi:feat/live-webhook-config
Open

mrjavadseydi wants to merge 6 commits into
pgsty:mainfrom
mrjavadseydi:feat/live-webhook-config

Conversation

@mrjavadseydi

@mrjavadseydi mrjavadseydi commented Oct 18, 2026 •

Copy link
Copy Markdown

Contribution Licensing (no CLA, inbound=outbound, DCO required)

This pull request contributes to PGSTY SILO (pgsty/silo). Code contributions
are accepted under AGPL-3.0-or-later, the same license as the server.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU Affero General Public License v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO Signed-off-by trailer
(git commit -s) certifying the
Developer Certificate of Origin — see
CONTRIBUTING.md.

Description

Adding a notification webhook currently needs a server restart before its ARN is available. This makes notify_webhook changes take effect through the existing admin config API and peer reload path. Adding, updating, disabling, re-enabling and removing a webhook no longer needs a restart.

Existing targets keep their identity and disk queue when their endpoint, token, client certificate or queue limit changes. Unchanged targets keep their current resources. In-flight POSTs finish with their original settings; later sends and retries use the updated settings.

Reload and removal avoid holding the target-list lock during HTTP delivery. Shutdown cancels outstanding requests before waiting for queue replay to stop. Invalid replacements leave the running targets intact, and config validation does not replay queued events.

Motivation and Context

Changing a webhook endpoint or adding an integration should not require restarting a storage node. Slow receivers also need to stay isolated: one blocked POST should not hold up registration, removal or notification metrics for every target on that node.

The tests cover these cases, along with reloads during startup, environment overrides and concurrent TLS initialization and shutdown.

How to test this PR?

Local checks on macOS arm64 with Go 1.27.2:

go test -race ./internal/config ./internal/config/notify ./internal/event ./internal/event/target ./internal/store -count=1 -timeout=5m
go test -short ./cmd -count=1 -timeout=10m
make verifiers
make build

Also tested four local SILO nodes with the maintained PGSTY mcli: register a webhook and bucket rule, PUT through each node, change the endpoint and token, disable and re-enable the target, reject invalid settings, and remove a target. Events reached the expected receiver and all server PIDs stayed unchanged. With a POST deliberately blocked, registration, removal and a cluster metrics scrape still completed. A rejected queue-directory change left the saved config and working webhook intact.

The full Linux suite is left to CI. The optional typos check was skipped because the binary was not installed locally.

Compatibility impact

  • Existing notify_webhook keys, MINIO_NOTIFY_WEBHOOK_* variables and notification ARNs stay unchanged. Other notification backends retain their existing reload behavior.
  • Changing queue_dir on an active webhook is rejected before the config is saved. Drain the queue and disable or remove the target before moving it to another directory.
  • Configuration and queue formats are unchanged. An older server can read them after rollback, but still needs a restart to apply webhook changes.

Documentation impact: the public operations docs should describe live webhook reloads and the queue-directory restriction. Those docs belong to pgsty/silo.pgsty.com; no documentation files are changed here.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • All commits are signed off (git commit -s) per the DCO
  • Fixes a regression (new behavior; no regression commit identified)
  • Unit tests added/updated
  • make verifiers passes
  • Relevant package tests and make build pass
  • Compatibility and rollback impact documented
  • Internal documentation updated (N/A: no internal documentation changes needed)
  • Public documentation update opened: docs(webhook): describe live notify_webhook reload and queue_dir restriction minio-docs#1 (companion-site PR for pgsty/silo.pgsty.com to follow)

@Vonng Vonng added this to the Next cycle milestone Oct 19, 2026
@Vonng

Vonng commented Oct 19, 2026

Copy link
Copy Markdown
Member

Thank you for the implementation and multi-node test details. Keeping this open for next-cycle review; webhook hot reload is not part of 20261018000000.

Review will focus on queued/in-flight delivery, failed configuration changes, peer reloads, and resource cleanup on the final revision. The live-reload behavior and queue-directory restriction also need companion-site documentation. This PR covers notify_webhook; it does not close the NATS-specific request in #40.

mrjavadseydi and others added 5 commits November 1, 2026 21:21
Retire a replaced webhook client only after its in-flight requests
finish, so the old certificate manager and idle connections are released
without cutting off a POST that is still running.

Cancel outstanding HTTP work before Close waits on the target lock, so a
slow queue write cannot delay shutdown of network requests.

Validate changed existing targets without reopening their live queue
store, while new targets still open queue_dir before the config is saved.

Log per-peer errors from the dynamic config reload signal instead of
discarding them.

Signed-off-by: mr javad seydi <[email protected]>
config.New shares the process-wide default KVS slice, so Set on it leaked enable=invalid into later tests and broke TestPoolsMultipartConditionalInitiateLifecycle in a full ./cmd run.

Signed-off-by: mr javad seydi <[email protected]>
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 this pull request may close these issues.

2 participants