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

fix the occasion of getNodeNameAndStorageClass error message #25

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

cupnes
Copy link
Contributor

@cupnes cupnes commented Nov 17, 2022

This PR fixes the following error by ignoring not found error because old events may refer the deleted pod.

1.6686630294454665e+09  ERROR   event-reconciler        failed to name of node and storage class related to the pod     {"pod": "pie-probe-10.69.1.139-ceph-canary-block-be4f7f-27807946-tc8sw", "error": "Pod \"pie-probe-10.69.1.139-ceph-canary-block-be4f7f-27807946-tc8sw\" not found"}
github.com/topolvm/pie/controllers.(*EventReconciler).SetupWithManager.func1.1
        /work/controllers/event_controller.go:170
github.com/topolvm/pie/controllers.(*EventReconciler).SetupWithManager.func1
        /work/controllers/event_controller.go:201

Signed-off-by: Yuma Ogami yuma-ogami@cybozu.co.jp
Co-authored-by: Toshikuni Fukaya toshikuni-fukaya@cybozu.co.jp

Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
Co-authored-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
@cupnes cupnes requested a review from a team as a code owner November 17, 2022 06:43
@cupnes cupnes self-assigned this Nov 17, 2022
@cupnes cupnes requested review from toshipp and peng225 and removed request for daichimukai and llamerada-jp November 17, 2022 06:43
Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
Co-authored-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
@peng225
Copy link
Contributor

peng225 commented Nov 18, 2022

because old events may refer the deleted pod.

I'm not sure if this is correct.
Once the measurement for a pod finished, countedFlag[podName] is set to true. When old events come in later, the pod should be ignored by the following check, so it seems to me that the "failed to name of ..." log does not appear.

if countedFlag[podName] {
continue
}

@toshipp
Copy link
Contributor

toshipp commented Nov 18, 2022

@peng225
It can happen in the following scenario.

  1. a pod was created and was deleted
  2. pie captures only create event
  3. controller tries to get the pod referred by the event, but it is deleted, therefore an error happens.
  4. pie captures the delete event
  5. controller can perform properly

@peng225
Copy link
Contributor

peng225 commented Nov 18, 2022

@toshipp Thank you for your explanation. I understand.

@peng225 peng225 merged commit 7735b15 into main Nov 18, 2022
@peng225 peng225 deleted the fix-getnodenameandstorageclass-err branch November 18, 2022 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants