Repository navigation
Make the UniFi request timeout configurable, default 90s - #462
Merged
Merged
Conversation
Listing every known client on a busy UniFi console can take longer than the old fixed 30s limit, so syncs failed with context deadline exceeded. Add unifi.timeout (5s to 10m, default 90s), a Request Timeout field in the wizard's connection step, and docs. The key is only written when set so older nodes can still read a replicated configuration.
drudge
commented
Oct 19, 2026
drudge
left a comment
Owner
Author
There was a problem hiding this comment.
Review by Blake, posted by Whiteface: approve. Code complete, CI green.
The cluster upgrade-order constraint is real, not cautious: internal/config/config.go:675 uses decoder.DisallowUnknownFields(), so a 1.7.1 node receiving a replicated config with unifi.timeout rejects it. The 1.7.2 release notes must say: upgrade every node before setting unifi.timeout. Also note the new setting and the 30s → 90s default change.
Whiteface: both go into the 1.7.2-beta.1 notes (#467).
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Nick
Before: every UniFi controller request had a fixed 30 second limit. On a busy console, listing reservations (
rest/user, which returns every client the controller has ever seen) can take longer than that, so the homelab sync failed every cycle withcontext deadline exceeded (Client.Timeout exceeded while awaiting headers).After: the limit defaults to 90 seconds and can be set with
unifi.timeout(5s to 10m), or from a new optional Request Timeout field on the wizard's connection step.How:
unifi.OptionsgainsTimeout, and zero falls back tounifi.DefaultRequestTimeout(90s).config.UniFigainsTimeoutwithomitemptyand aRequestTimeout()helper, so an unset value is never written to the file. Validation rejects values outside 5s to 10m, and the wizard checks the field before it stores credentials. Both sync and preview pass the timeout through.Upgrading
Nothing new is needed. A node from before this change can't read
unifi.timeout, so in a cluster, upgrade every node before you set it. Until it's set, the key stays out of the replicated config.Checks
go tool mage verifypasses andgofmt -l .is cleanScreenshots
UniFi setup wizard, connection step (
/integrations?setup=unifi), scrolled to the bottom. Before ismain, after is this branch.