Skip to content

fix(pipeline): fix potiential panic#6484

Merged
abeizn merged 1 commit into
apache:mainfrom
merico-ai:fix-panic-1120
Nov 20, 2023
Merged

fix(pipeline): fix potiential panic#6484
abeizn merged 1 commit into
apache:mainfrom
merico-ai:fix-panic-1120

Conversation

@d4x1
Copy link
Copy Markdown
Contributor

@d4x1 d4x1 commented Nov 20, 2023

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

What does this PR do?
Fix a potiential panic.
When a blueprint is triggered, all pipelines behind it will be executed. If a pipeline is canceled manually. the running pipeline will still go on, and this will lead to a panic.

here are panic logs:

[GIN] 2023/11/19 - 22:18:08 | 201 |    10.36002ms |   {ip} | POST     "/blueprints"
time="2023-11-19 22:18:08" level=info msg="path /blueprints/3817/trigger will continue"
time="2023-11-19 22:18:08" level=info msg="try locking tables with timeout 2s"
[GIN] 2023/11/19 - 22:18:08 | 200 |   39.843051ms |   {ip} | POST     "/blueprints/3817/trigger"
time="2023-11-19 22:18:08" level=info msg="path /pipelines will continue"
[GIN] 2023/11/19 - 22:18:08 | 200 |   80.326947ms |   {ip} | GET      "/pipelines?blueprint_id=3817&page=1&pageSize=1&pending=1"
time="2023-11-19 22:18:08" level=info msg="path /pipelines/110925 will continue"
time="2023-11-19 22:18:08" level=info msg=" [pipeline service] get lock and wait next pipeline"
time="2023-11-19 22:18:08" level=info msg=" [pipeline service] run pipeline, 110925, now running runningParallelLabels are [parallel/jenkins_sync]"
[GIN] 2023/11/19 - 22:18:08 | 200 |   53.667161ms |   {ip} | DELETE   "/pipelines/110925"
time="2023-11-19 22:18:08" level=info msg=" [pipeline service] finish pipeline #110925, now runningParallelLabels is []"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x170cb37]

goroutine 184483 [running]:
github.com/apache/incubator-devlake/core/runner.runPipelineTasks({0x20d86d0, 0xc002ab6750}, 0xc003ae8570?, {0xc005a57c18, 0x0, 0xadb90a?}, 0xc005a57dd8)
	/app/backend/core/runner/run_pipeline.go:93 +0x517
github.com/apache/incubator-devlake/core/runner.RunPipeline({0x20d86d0, 0xc002ab6750}, 0xc00283e450?, 0x1a86fa8?)
	/app/backend/core/runner/run_pipeline.go:53 +0x41b
github.com/apache/incubator-devlake/server/services.(*pipelineRunner).runPipelineStandalone(0xc005a57eb0)
	/app/backend/server/services/pipeline_runner.go:41 +0x65
github.com/apache/incubator-devlake/server/services.runPipeline(0xc002aa0f00?)
	/app/backend/server/services/pipeline_runner.go:113 +0x88
github.com/apache/incubator-devlake/server/services.RunPipelineInQueue.func1(0x1b14d, {0xc00310fa70?, 0xe42b26?, 0xc0046b1b00?})
	/app/backend/server/services/pipeline.go:264 +0x1c5
created by github.com/apache/incubator-devlake/server/services.RunPipelineInQueue
	/app/backend/server/services/pipeline.go:255 +0xa7
time="2023-11-19 22:18:11" level=info msg="plugin loaded sonarqube"
time="2023-11-19 22:18:11" level=info msg="plugin loaded sprint-performance-enricher"
time="2023-11-19 22:18:11" level=info msg="plugin loaded starrocks"
time="2023-11-19 22:18:11" level=info msg="plugin loaded tapd"
time="2023-11-19 22:18:12" level=info msg="plugin loaded teambition"
time="2023-11-19 22:18:12" level=info msg="plugin loaded trello"
time="2023-11-19 22:18:12" level=info msg="plugin loaded webhook"
time="2023-11-19 22:18:12" level=info msg="plugin loaded zentao"

Does this close any open issues?

Closes N/A

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

@abeizn abeizn merged commit 3adb9d2 into apache:main Nov 20, 2023
@d4x1 d4x1 added the cherrypick-completed Use this alongside needs-cherrypick-* labels after the PR has been cherrypicked. label Nov 20, 2023
@d4x1 d4x1 added this to the v0.21 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherrypick-completed Use this alongside needs-cherrypick-* labels after the PR has been cherrypicked. needs-cherrypick-v0.19 needs-cherrypick-v0.20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants