Code Monkey home page Code Monkey logo

Comments (8)

chuangw6 avatar chuangw6 commented on July 3, 2024

It looks like Tekton intends to mark PR as canceled after all its child TRs are marked as canceled successfully (code source).

However, taskrun reconciler needs a bit time to reconcile to mark child TR as canceled and to emit the final update after pipelinerun reconciler patches the tr. Since pipelinerun reconciler cancels the PipelineRun and emits it immediately after patching the taskruns, the pr is emitted prior to tr being emitted and has earlier completion time.

from pipeline.

chuangw6 avatar chuangw6 commented on July 3, 2024

Looked into the log a bit more. It looks like the parent pipelinerun was canceled twice and thus 2 terminal pipelinerun events were emitted (first line and last line in the following log). Both 2 events reported pipelinerun with terminal state condition status==false that means it's done, but the completion time and LastTransitionTime are changed in the second event, which is confusing.

{"severity":"warn","timestamp":"2024-06-07T00:02:46.271Z","logger":"tekton-pipelines-controller","caller":"pipelinerun/pipelinerun.go:253","message":">>>> emitting pipelinerun, name: tekton-pr-emit-ha, completion time: 2024-06-07 00:02:46.271534506 +0000 UTC m=+113.976747118, condition status: False, condition ltt: {2024-06-07 00:02:46.271533558 +0000 UTC m=+113.976746181}","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"3501b088-0278-43ac-b67c-e25e44298096","knative.dev/key":"default/tekton-pr-emit-ha"}
{"severity":"info","timestamp":"2024-06-07T00:02:46.271Z","logger":"tekton-pipelines-controller.event-broadcaster","caller":"record/event.go:364","message":"Event(v1.ObjectReference{Kind:\"PipelineRun\", Namespace:\"default\", Name:\"tekton-pr-emit-ha\", UID:\"e96bb31f-a06b-46f9-b3a1-a74a50360d04\", APIVersion:\"tekton.dev/v1\", ResourceVersion:\"170179062\", FieldPath:\"\"}): type: 'Warning' reason: 'Failed' PipelineRun \"tekton-pr-emit-ha\" was cancelled","commit":"edf7e90-dirty"}
{"severity":"warn","timestamp":"2024-06-07T00:02:46.286Z","logger":"tekton-pipelines-controller","caller":"taskrun/taskrun.go:166","message":">>>> emitting taskrun, name: tekton-pr-emit-ha-matrix-task-ha, completion time: 2024-06-07 00:02:46.271505564 +0000 UTC m=+113.976718177, condition status: False, condition ltt: {2024-06-07 00:02:46.271493449 +0000 UTC m=+113.976706071}","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.taskrun.Reconciler","knative.dev/kind":"tekton.dev.TaskRun","knative.dev/traceid":"e0a1fea5-640b-40ec-a647-984ee0248077","knative.dev/key":"default/tekton-pr-emit-ha-matrix-task-ha"}
{"severity":"info","timestamp":"2024-06-07T00:02:46.288Z","logger":"tekton-pipelines-controller.event-broadcaster","caller":"record/event.go:364","message":"Event(v1.ObjectReference{Kind:\"TaskRun\", Namespace:\"default\", Name:\"tekton-pr-emit-ha-matrix-task-ha\", UID:\"941e7a91-c8b3-400c-b29c-56f79237057f\", APIVersion:\"tekton.dev/v1\", ResourceVersion:\"170179063\", FieldPath:\"\"}): type: 'Warning' reason: 'Failed' TaskRun \"tekton-pr-emit-ha-matrix-task-ha\" was cancelled. TaskRun cancelled as the PipelineRun it belongs to has been cancelled.","commit":"edf7e90-dirty"}
{"severity":"info","timestamp":"2024-06-07T00:02:46.296Z","logger":"tekton-pipelines-controller","caller":"controller/controller.go:550","message":"Reconcile succeeded","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"3501b088-0278-43ac-b67c-e25e44298096","knative.dev/key":"default/tekton-pr-emit-ha","duration":0.047430652}
{"severity":"info","timestamp":"2024-06-07T00:02:46.296Z","logger":"tekton-pipelines-controller","caller":"pipelinerun/cancel.go:139","message":"cancelling TaskRun tekton-pr-emit-ha-matrix-task-ha","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"47592fa6-3a06-4274-b05e-58d33303fc21","knative.dev/key":"default/tekton-pr-emit-ha"}
{"severity":"info","timestamp":"2024-06-07T00:02:46.311Z","logger":"tekton-pipelines-controller","caller":"controller/controller.go:550","message":"Reconcile succeeded","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.taskrun.Reconciler","knative.dev/kind":"tekton.dev.TaskRun","knative.dev/traceid":"e0a1fea5-640b-40ec-a647-984ee0248077","knative.dev/key":"default/tekton-pr-emit-ha-matrix-task-ha","duration":0.040763412}
{"severity":"info","timestamp":"2024-06-07T00:02:46.312Z","logger":"tekton-pipelines-controller","caller":"taskrun/taskrun.go:149","message":"taskrun done : tekton-pr-emit-ha-matrix-task-ha \n","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.taskrun.Reconciler","knative.dev/kind":"tekton.dev.TaskRun","knative.dev/traceid":"a65f95f4-9b47-40f6-9b0f-93f325712bca","knative.dev/key":"default/tekton-pr-emit-ha-matrix-task-ha"}
{"severity":"info","timestamp":"2024-06-07T00:02:46.312Z","logger":"tekton-pipelines-controller","caller":"controller/controller.go:550","message":"Reconcile succeeded","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.taskrun.Reconciler","knative.dev/kind":"tekton.dev.TaskRun","knative.dev/traceid":"a65f95f4-9b47-40f6-9b0f-93f325712bca","knative.dev/key":"default/tekton-pr-emit-ha-matrix-task-ha","duration":0.000230135}
{"severity":"warn","timestamp":"2024-06-07T00:02:46.331Z","logger":"tekton-pipelines-controller","caller":"pipelinerun/pipelinerun.go:253","message":">>>> emitting pipelinerun, name: tekton-pr-emit-ha, completion time: 2024-06-07 00:02:46.331209788 +0000 UTC m=+114.036422401, condition status: False, condition ltt: {2024-06-07 00:02:46.331207784 +0000 UTC m=+114.036420413}","commit":"edf7e90-dirty","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"47592fa6-3a06-4274-b05e-58d33303fc21","knative.dev/key":"default/tekton-pr-emit-ha"}

from pipeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.