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 trying to add to a not started workqueue #60

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

g-pavlov
Copy link
Contributor

@g-pavlov g-pavlov commented Oct 22, 2020

What this PR does / why we need it:

Fixes occasional panic: Trying to add to a not started workqueue

github.com/gardener/docforge/pkg/jobs.(*workQueue).Add(0xc000368900, 0x15f38a0, 0xc0000bd190)
        /Users/i342793/go/src/github.com/gardener/docforge/pkg/jobs/workqueue.go:72 +0x13d
github.com/gardener/docforge/pkg/jobs.(*controller).Enqueue.func1(0x17d8760, 0xc000338b80, 0xc000368920, 0x15f38a0, 0xc0000bd190)
        /Users/i342793/go/src/github.com/gardener/docforge/pkg/jobs/controller.go:76 +0x7f
created by github.com/gardener/docforge/pkg/jobs.(*controller).Enqueue
        /Users/i342793/go/src/github.com/gardener/docforge/pkg/jobs/controller.go:70 +0x67
panic: Trying to add to a not started workqueue

Special notes for your reviewer:
The hypothesis is that download task enqueue was a go routine and did not block until done so the document worker could exit early. Occasionally that satisfied the conditions to shutdown the queues and the download tasks queue happened to be nil at the time the enqueue tries to add to the queue. The fix removes makes the document worker wait until the download task is added and overall the enqueue a bit more fault tolerant yet informative for the status of the operation.

Release note:

Fixes occasional `panic: Trying to add to a not started workqueue`

@g-pavlov g-pavlov added the component/documentation Gardener Documentation label Oct 22, 2020
@g-pavlov g-pavlov self-assigned this Oct 22, 2020
@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Oct 22, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 22, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 22, 2020
@g-pavlov g-pavlov merged commit 36f1e23 into master Oct 22, 2020
@g-pavlov g-pavlov changed the title Fixsendonclosedchannel Fix trying to add to a not started workqueue Oct 22, 2020
@g-pavlov g-pavlov deleted the fixsendonclosedchannel branch October 22, 2020 13:35
@g-pavlov g-pavlov removed the needs/review Needs review label Oct 22, 2020
@gardener-robot gardener-robot added the needs/review Needs review label Oct 22, 2020
@g-pavlov g-pavlov removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review labels Oct 22, 2020
@gardener-robot gardener-robot added the needs/review Needs review label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/documentation Gardener Documentation needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants