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

suspend go routines until operator cache is ready #2327

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

qpdpQ
Copy link
Contributor

@qpdpQ qpdpQ commented Dec 5, 2024

What this PR does / why we need it:
Go routines in ibm-common-service operator relies on operator controller's cache to be ready. It will be ready when Manager is set up. So we need to suspend go routines until manager is setup
Which issue(s) this PR fixes:
Fixes # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/58246

qpdpQ added 3 commits December 5, 2024 12:06
Signed-off-by: Allen Li <[email protected]>
Signed-off-by: Allen Li <[email protected]>
Signed-off-by: Allen Li <[email protected]>
@qpdpQ
Copy link
Contributor Author

qpdpQ commented Dec 5, 2024

test logs

I1205 17:19:22.921189 1 request.go:601] Waited for 1.015067982s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/velero.io/v2alpha1?timeout=32s
1.7334191651816728e+09 INFO controller-runtime.metrics Metrics server is starting to listen {"addr": ":8080"}
I1205 17:19:25.182289 1 main.go:131] Identifying Common Service Operator Role in the namespace mcsp
I1205 17:19:25.273543 1 init.go:160] Single Deployment Status: false, MultiInstance Deployment status: true, SaaS Depolyment Status: false
I1205 17:19:33.040389 1 request.go:601] Waited for 1.043724581s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/foundation.ibm.com/v1?timeout=32s
I1205 17:19:35.343215 1 operator_status.go:39] start update CSCR
I1205 17:19:42.049930 1 operator_status.go:42] Get bs from channel
1.7334191820499256e+09 INFO controller-runtime.webhook Registering webhook {"path": "/validate-operator-ibm-com-v3-commonservice"}
1.7334191820506086e+09 INFO controller-runtime.webhook Registering webhook {"path": "/mutate-operator-ibm-com-v1alpha1-operandrequest"}
I1205 17:19:42.050701 1 main.go:245] Starting manager

it takes about 7 seconds to wait

I1205 17:19:35.343215 1 operator_status.go:39] start update CSCR
I1205 17:19:42.049930 1 operator_status.go:42] Get bs from channel

@qpdpQ qpdpQ changed the title suspend go routines until operator cachs is ready suspend go routines until operator cache is ready Dec 5, 2024
main.go Outdated Show resolved Hide resolved
qpdpQ added 2 commits December 9, 2024 14:35
Signed-off-by: Allen Li <[email protected]>
@qpdpQ
Copy link
Contributor Author

qpdpQ commented Dec 9, 2024

test looks good to me:

I1209 19:40:32.208551 1 request.go:601] Waited for 1.003899204s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/ceph.rook.io/v1?timeout=32s
1.7337732344705563e+09 INFO controller-runtime.metrics Metrics server is starting to listen {"addr": ":8080"}
I1209 19:40:34.471243 1 main.go:131] Identifying Common Service Operator Role in the namespace mcsp
I1209 19:40:34.564602 1 init.go:160] Single Deployment Status: false, MultiInstance Deployment status: true, SaaS Depolyment Status: false
I1209 19:40:42.332863 1 request.go:601] Waited for 1.042902052s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/imageregistry.operator.openshift.io/v1?timeout=32s
I1209 19:40:44.635814 1 main.go:166] start commonservice manager
I1209 19:40:47.991087 1 main.go:176] start go routines
I1209 19:40:51.345092 1 main.go:189] Set up certmanager Manager
1.7337732513455667e+09 INFO controller-runtime.webhook Registering webhook {"path": "/validate-operator-ibm-com-v3-commonservice"}
1.733773251345751e+09 INFO controller-runtime.webhook Registering webhook {"path": "/mutate-operator-ibm-com-v1alpha1-operandrequest"}
I1209 19:40:51.345855 1 main.go:248] Starting manager
1.733773251346604e+09 INFO controller-runtime.webhook.webhooks Starting webhook server

@qpdpQ qpdpQ requested a review from Daniel-Fan December 9, 2024 19:45
Copy link
Contributor

@Daniel-Fan Daniel-Fan left a comment

Choose a reason for hiding this comment

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

/lgtm

@ibm-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Daniel-Fan, qpdpQ

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

@ibm-ci-bot ibm-ci-bot merged commit 7cdb53c into IBM:master Dec 9, 2024
6 of 7 checks passed
Daniel-Fan added a commit to Daniel-Fan/ibm-common-service-operator that referenced this pull request Dec 11, 2024
ibm-ci-bot pushed a commit that referenced this pull request Dec 11, 2024
* Revert "suspend go routines until operator cache is ready (#2327)"

This reverts commit 7cdb53c.

* start go routines after cs controller manager setup

Signed-off-by: Daniel Fan <[email protected]>

---------

Signed-off-by: Daniel Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants