Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force backend sync when worker starts #2511

Merged
merged 1 commit into from
May 14, 2018

Conversation

ElvinEfendi
Copy link
Member

@ElvinEfendi ElvinEfendi commented May 14, 2018

What this PR does / why we need it:
We have been seeing constant

no backend configuration found for...

errors in our clusters. The debugging showed that they correlate to Nginx reloads. What happens is when Nginx reloads we wait 1s before syncing backends to local worker memory. And during that time all requests fail. The PR fix that bug and also makes sure we return 503 when backend is not found.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 14, 2018
@ElvinEfendi
Copy link
Member Author

/assign @aledbf

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 14, 2018
@aledbf
Copy link
Member

aledbf commented May 14, 2018

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2018
@aledbf aledbf mentioned this pull request May 14, 2018
4 tasks
@@ -28,6 +28,7 @@ local function get_current_backend()
local backend = backends:get(backend_name)

if not backend then
-- TODO(elvinefendi) maybe force backend sync here?
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we want to call sync_backends in the init phase? Which occurs before the worker processes are forked? Alternately you can sync_backend if init_worked hasn't been called at least once. Wondering if you had input @aledbf?

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewlouis93 init phase is not per worker, what's the point of calling this function there? We need to sync backends per worker - that's why we use init_worker to do so, which is init but per worker.

Copy link
Member Author

Choose a reason for hiding this comment

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

after this PR I actually can not think of any reason why we would wanna implement what I say in this TODO.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, we're not populating a shared dictionary - backends is per worker.

after this PR I actually can not think of any reason why we would wanna implement what I say in this TODO.

😂 make sure you nip your TODO next PR :)

@andrewloux
Copy link
Contributor

Have one question, looks good otherwise!

@codecov-io
Copy link

Codecov Report

Merging #2511 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2511   +/-   ##
=======================================
  Coverage   41.64%   41.64%           
=======================================
  Files          74       74           
  Lines        5276     5276           
=======================================
  Hits         2197     2197           
  Misses       2781     2781           
  Partials      298      298
Impacted Files Coverage Δ
internal/file/bindata.go 62.4% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6aeb7ce...44ddd8a. Read the comment docs.

@k8s-ci-robot k8s-ci-robot merged commit 7983a2b into kubernetes:master May 14, 2018
@ElvinEfendi ElvinEfendi deleted the bug-fix branch May 14, 2018 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants