Skip to content

Comments

[BUGFIX] Release lock if pool.ContainerInWorker errors.#4293

Merged
kcmannem merged 1 commit intoconcourse:masterfrom
Pix4D:bugfix_release_containerinworker_errors
Aug 22, 2019
Merged

[BUGFIX] Release lock if pool.ContainerInWorker errors.#4293
kcmannem merged 1 commit intoconcourse:masterfrom
Pix4D:bugfix_release_containerinworker_errors

Conversation

@aledegano
Copy link
Contributor

Whenever ContainerInWorker returned an error the Active Tasks Lock
would never be released, blocking any task to check for available
workers and thus to start.

Here the bug is fixed, by releasing the lock if the ContainerInWorker
returns an error.

Additionally the unit tests are expanded to verify that for every
lock acquisition a lock release is also called.

Signed-off-by: Alessandro Degano [email protected]

@aledegano aledegano requested a review from a team August 19, 2019 15:06
@aledegano aledegano force-pushed the bugfix_release_containerinworker_errors branch from 08a0d45 to 6d11979 Compare August 20, 2019 09:30
@aledegano
Copy link
Contributor Author

@ddadlani when you have a moment, can you check this small PR out?
Thanks!

if err != nil {
release_err := activeTasksLock.Release()
if release_err != nil {
return nil, release_err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

Wdyt of leveraging a multierror (e.g.,

errs = multierror.Append(errs, err)
) here?

This way we wouldn't lose the original error that came from client.pool.ContainerInWorker.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Good point!

Whenever ContainerInWorker returned an error the Active Tasks Lock
would never be released, blocking any task to check for available
workers and thus to start.

Here the bug is fixed, by releasing the lock if the ContainerInWorker
returns an error.

Additionally the unit tests are expanded to verify that for every
lock acquisition a lock release is also called.

Signed-off-by: Alessandro Degano <[email protected]>
@aledegano aledegano force-pushed the bugfix_release_containerinworker_errors branch from 6d11979 to 25e5cd5 Compare August 22, 2019 12:45
Copy link
Contributor

@kcmannem kcmannem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kcmannem kcmannem merged commit 1736b41 into concourse:master Aug 22, 2019
@jamieklassen jamieklassen added this to the v5.5.0 milestone Aug 26, 2019
@jamieklassen jamieklassen added the release/undocumented This didn't warrant being documented or put in release notes. label Aug 26, 2019
jamieklassen pushed a commit that referenced this pull request Aug 26, 2019
#4118
#4148
#4208
#4277
#4142
#4221
#4293

Signed-off-by: James Thomson <[email protected]>
Co-authored-by: Jamie Klassen <[email protected]>
matthewpereira pushed a commit that referenced this pull request Sep 5, 2019
#4118
#4148
#4208
#4277
#4142
#4221
#4293

Signed-off-by: James Thomson <[email protected]>
Co-authored-by: Jamie Klassen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/undocumented This didn't warrant being documented or put in release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants