-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Http probe request object reuse #133109
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
base: master
Are you sure you want to change the base?
Http probe request object reuse #133109
Conversation
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Welcome @Ahmed-Elgamel! |
|
Hi @Ahmed-Elgamel. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ahmed-Elgamel The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cc @aojea @SergeyKanzhelev |
SergeyKanzhelev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is new approach that introduces the least amount of changes at once. Many previous attempts were a lot of refactoring at once.
I like this, even though I believe more refactoring is needed in this package.
Please keep working on it - add some unit tests and clean up logging. We should come back to it very early in 1.35, once we done with 1.34
…ame request without everytime constructing a new request object
- Remove the fallback HTTP request creation logic in the prober file - Remove the request object null check since the http probing fuction (runProbe) will not be called if the worker failed to create the http request object and the worker will keep on trying again - Improve error logging
Initialize httpProbeRequestHolder for HTTP probes in newWorker function The holder is created with empty podIP initially, which will be set dynamically during probe execution (in worker loop). This approach handles cases where: - Pod is created but not yet scheduled to a node (no IP available) - Pod IP changes during pod lifecycle (rescheduling, network changes) - Pod IP becomes available after worker creation The podIP is intentionally left empty in newWorker because: 1. Pod may not be scheduled to a node yet when worker is created 2. Pod IP can change during pod lifecycle 3. Dynamic IP assignment in worker loop ensures current IP is always used (next step) Next step: Handle pod IP changes in worker loop by updating/resetting the httpProbeRequestHolder when IP changes are detected.
Reset/Invalidate cached HTTP request when pod IP changes to ensure probes always use the current pod IP address. This handles pod rescheduling and network configuration changes during the pod lifecycle.
c4b5de2 to
1e44895
Compare
|
I have rebased against master and removed merge commits. Ready for another review. |
|
/auto-cc |
|
/ok-to-test |
|
/test pull-kubernetes-unit-windows-master |
|
Is the pull-kubernetes-unit-windows-master test supposed to fail? I think there is an issue with the CI environment that is being setup because I thought something was wrong with my unit test case. Also, I refactored the unit test case for better readability. |
|
@SergeyKanzhelev @haircommander will this pr be merged or is there review to be done on it still? |
|
I’m wondering if this change is not planned for v1.35, could someone share what went wrong / what could be improved in this PR so I can learn and do better next time? |
|
@Ahmed-Elgamel we are not into code freeze yet, I think @SergeyKanzhelev can still merge it. |
|
/test pull-kubernetes-unit-windows-master |
|
@Ahmed-Elgamel: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
rebase, squash commits. And I also hoped for some review with lgtm on this. We are close to code freeze again, so likely this will miss the deadline again |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Avoid creating a new request object everytime when making an http probe instead the worker just constructs the request once and every http probe uses the same request object
Which issue(s) this PR is related to:
Fixes #115939
Special notes for your reviewer:
I am open to any modification to my approach for request reuse.
My implemntation was as follows:
If there’s a better approach or anything you’d like me to change, I’m happy to do so.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: