Repository navigation
fix(functions): make FUNCTIONS_DISCOVERY_TIMEOUT harder to misconfigure - #11628
Open
IzaakGough wants to merge 6 commits into
Open
IzaakGough wants to merge 6 commits into
IzaakGough wants to merge 6 commits into
Conversation
Accept an s or ms suffix, warn when a bare value looks like milliseconds, and warn about values that cannot be parsed. The timeout error now names the variable and reports the elapsed time in seconds.
IzaakGough
added a commit
that referenced
this pull request
Dec 2, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances the FUNCTIONS_DISCOVERY_TIMEOUT environment variable parsing to support explicit 's' and 'ms' suffixes, cache parsed values, and warn users about suspicious bare values that might be mistaken for milliseconds. It also updates the timeout error messages to be more descriptive. The review feedback recommends restricting the suspicious value warning to bare numbers to prevent incorrect remediation suggestions (such as '600sms') and calling timer.unref() on the timeout in detectFromPort to avoid keeping the Node.js event loop active unnecessarily.
IzaakGough
marked this pull request as ready for review
December 2, 2026 14:10
This branch has not been deployed
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.
FUNCTIONS_DISCOVERY_TIMEOUTis read in seconds, but the timeout error printed milliseconds and did not name the variable, so values like30000(8.3 hours) were common.This accepts an
sormssuffix, warns about a bare value of 600 or more and about values it cannot parse, and makes the timeout error name the variable and give the time in seconds.Tested with unit tests. Not tested against a real emulator or deploy.