Skip to content

feat: add support for disabling route polling - #3722

Closed
MustafaSaber wants to merge 2 commits into
cw2025from
block-routing-polls-if-not-needed
Closed

feat: add support for disabling route polling#3722
MustafaSaber wants to merge 2 commits into
cw2025from
block-routing-polls-if-not-needed

Conversation

@MustafaSaber

Copy link
Copy Markdown
Collaborator
  • Add ability to disable route polling by setting source-poll-timeout to 0
  • Return HTTP 204 No Content when polling is disabled

This will help with running skipperbinary in webhook mode as we need to use -kubernetes flag to enable some filter registries but we don't want skipper to overload/pull data from k8s apiserver

  • Add more tests

@MustafaSaber MustafaSaber added the major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs label Nov 10, 2025
@zalando-robot

Copy link
Copy Markdown

Deployment Checklist

This change falls under the deployment policy.

💁 Since Nov 10th, we are in the RED deployment zone. This means all changes released to production must adhere to the following requirements:

  • Detailed release notes are provided in this PR’s description.
  • Thorough load-testing has been performed, and is documented in the description/comment.
  • Technical review: Principal Engineers or Tech Leads have green-lit your changes, and the reviewer is named in the description/comments.
  • You can enable/disable the change via feature toggles, and have confirmed these toggles work as expected.
  • Application Owner (Director+) approval is given about the PR, and the approver is named in the description/comments.

👉 Regardless of which boxes you click in this comment, merge/deployment will not be blocked.
Reports about deployment policy adherence will be circulated daily for Cyber-Week-relevant applications.

@szuecs

szuecs commented Nov 10, 2025

Copy link
Copy Markdown
Member

I think we should not use 0, but maybe -1

Comment thread skipper.go Outdated

// ensure a non-zero poll timeout
if o.SourcePollTimeout <= 0 {
if o.SourcePollTimeout < 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change defaults

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is already int64(3000) it's what we use now. We only update to use the default in case of invalid input like 0 or negative

Comment thread config/config.go
flag.StringVar(&cfg.InlineRoutes, "inline-routes", "", "inline routes in eskip format")
flag.StringVar(&cfg.ForwardBackendURL, "forward-backend-url", "", "target url of the <forward> backend")
flag.Int64Var(&cfg.SourcePollTimeout, "source-poll-timeout", int64(3000), "polling timeout of the routing data sources, in milliseconds")
flag.Int64Var(&cfg.SourcePollTimeout, "source-poll-timeout", int64(3000), "polling timeout of the routing data sources, in milliseconds. Use 0 to not poll routes.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not enough to create a default other than 0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not enough?

@szuecs szuecs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable on <0 and 0 is default, which sets our chosen default.

Comment thread routing/routing.go Outdated
- Add ability to disable route polling by setting source-poll-timeout to 0
- Return HTTP 204 No Content when polling is disabled

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
… is because 0 will override routing.Options and most tests will fail

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
@MustafaSaber
MustafaSaber force-pushed the block-routing-polls-if-not-needed branch from a03cb0f to 2605b4c Compare November 11, 2025 14:59
MustafaSaber added a commit that referenced this pull request Nov 12, 2025
This allows k8s dataclient to run without loading routing table (which won't call apisever), this will
allow us to use k8s dataclient in webhook mode to enable some filters without calling apiserver and may
allow us later to get redis endpoints wihout calling routeSRV.

This should replace #3722 which disable polling routing across all dataclients
which maybe not desriable.
MustafaSaber added a commit that referenced this pull request Nov 12, 2025
This allows k8s dataclient to run without loading routing table (which won't call apisever), this will
allow us to use k8s dataclient in webhook mode to enable some filters without calling apiserver and may
allow us later to get redis endpoints wihout calling routeSRV.

This should replace #3722 which disable polling routing across all dataclients
which maybe not desriable.

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
@MustafaSaber

Copy link
Copy Markdown
Collaborator Author

close in favor of #3729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants