Skip to content

Conversation

@mrnugget
Copy link
Contributor

Running :GoMetaLinter just pointed me to this "ineffective break
statement" that I introduced in #328 with the following comment:

It also makes sure that we don't enqueue more tasks/steps after being
canceled: that's the code in (*executor).Start() that aborts the
Range call if the context has been cancelled/timed-out and aborts
execution of a task if the goroutine already blocked on
x.par.Acquire().

Well... turns out that wasn't the case, was it?

Instead the code only broke out of the select and continued trying to
acquire a lock.

I also suspect that this bug might have something to do with a customer
reporting that long-running containers are not stopped when hitting
Ctrl-C (https://github.com/sourcegraph/sourcegraph/issues/16026) even
after we thought the issue was fixed with #328. I'm not 100% sure on
this one though.

Running `:GoMetaLinter` just pointed me to this "ineffective break
statement" that I introduced in #328 with the following comment:

> It also makes sure that we don't enqueue more tasks/steps after being
> canceled: that's the code in `(*executor).Start()` that aborts the
> `Range` call if the context has been cancelled/timed-out and aborts
> execution of a task if the goroutine already blocked on
> `x.par.Acquire()`.

Well... turns out that wasn't the case, was it?

Instead the code only broke out of the `select` and continued trying to
acquire a lock.

I also suspect that this bug might have something to do with a customer
reporting that long-running containers are not stopped when hitting
Ctrl-C (https://github.com/sourcegraph/sourcegraph/issues/16026) even
after we thought the issue was fixed with #328. I'm not 100% sure on
this one though.
@mrnugget mrnugget requested a review from a team January 21, 2021 11:05
@mrnugget mrnugget merged commit 2540cb2 into main Jan 21, 2021
@mrnugget mrnugget deleted the mrn/fix-wrong-break branch January 21, 2021 12:32
scjohns pushed a commit that referenced this pull request Apr 24, 2023
Running `:GoMetaLinter` just pointed me to this "ineffective break
statement" that I introduced in #328 with the following comment:

> It also makes sure that we don't enqueue more tasks/steps after being
> canceled: that's the code in `(*executor).Start()` that aborts the
> `Range` call if the context has been cancelled/timed-out and aborts
> execution of a task if the goroutine already blocked on
> `x.par.Acquire()`.

Well... turns out that wasn't the case, was it?

Instead the code only broke out of the `select` and continued trying to
acquire a lock.

I also suspect that this bug might have something to do with a customer
reporting that long-running containers are not stopped when hitting
Ctrl-C (https://github.com/sourcegraph/sourcegraph/issues/16026) even
after we thought the issue was fixed with #328. I'm not 100% sure on
this one though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants