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

Allow configuring concurrent cleanup #4215

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

Martchus
Copy link
Contributor

  • Default behavior remains unchanged (all cleanup tasks block each other)
  • For simplicity this setting affects all cleanup tasks (and not just asset
    and result cleanup).
  • See https://progress.opensuse.org/issues/98922

okurz
okurz previously requested changes Sep 20, 2021
Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

I suggest to also add something to the documentation without duplicating the comments from etc.

etc/openqa/openqa.ini Outdated Show resolved Hide resolved
etc/openqa/openqa.ini Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #4215 (93ac34c) into master (3e54b33) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4215   +/-   ##
=======================================
  Coverage   97.91%   97.91%           
=======================================
  Files         369      369           
  Lines       33366    33387   +21     
=======================================
+ Hits        32671    32692   +21     
  Misses        695      695           
Impacted Files Coverage Δ
lib/OpenQA/Setup.pm 98.44% <ø> (ø)
t/config.t 100.00% <ø> (ø)
lib/OpenQA/Task/Asset/Limit.pm 100.00% <100.00%> (ø)
lib/OpenQA/Task/AuditEvents/Limit.pm 100.00% <100.00%> (ø)
lib/OpenQA/Task/Bug/Limit.pm 100.00% <100.00%> (ø)
lib/OpenQA/Task/Job/Limit.pm 99.17% <100.00%> (ø)
lib/OpenQA/Task/Utils.pm 100.00% <100.00%> (ø)
t/37-limit_assets.t 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e54b33...93ac34c. Read the comment docs.

docs/GettingStarted.asciidoc Outdated Show resolved Hide resolved
* Default behavior remains unchanged (all cleanup tasks block each other)
* For simplicity this setting affects all cleanup tasks (and not just asset
  and result cleanup).
* See https://progress.opensuse.org/issues/98922
* Improve phrasing of introduction
* Add advanced cleanup section
* Improve references
* Fix positioning of element IDs (so one can see the heading when using
  internal links)
@Martchus Martchus dismissed okurz’s stale review September 21, 2021 12:12

I addressed all mentioned issues.

Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

Lovely :)

Copy link
Member

@kalikiana kalikiana left a comment

Choose a reason for hiding this comment

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

I remember wondering why these weren't supposed to run in parallel. Nice to see this straight-forward support for enabling it!

# Specifies whether different cleanup tasks can run in parallel. This option
# makes particularly sense if assets and results are stored on different storage
# locations or if your common storage solution is performant enough.
concurrent = 0
Copy link
Member

Choose a reason for hiding this comment

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

For some reason I thought this might take a number of tasks to run in parallel. Looking at the implementation clarified that of course... might be clear enough anyway, just wanted to mention it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope the word "whether" in the comment makes it clear that this is just a flag.

Copy link
Member

Choose a reason for hiding this comment

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

would it be possible to use bools like "true" or "false" here? This would clarify all ambiguity. If not I think mentioning it in the comment would make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Perl there's no true/false do this would require extra handling and would be inconsistent with other settings.

@mergify mergify bot merged commit e6e0580 into os-autoinst:master Sep 22, 2021
openqa-git-sync pushed a commit to os-autoinst/salt-states-openqa that referenced this pull request Sep 22, 2021
@Martchus Martchus deleted the concurrent-cleanup branch September 22, 2021 15:41
openqabot pushed a commit to openqabot/openQA that referenced this pull request Sep 23, 2021
commit e6e0580
Merge: c0a92ba 93ac34c
Author:     mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
AuthorDate: Wed Sep 22 15:38:49 2021 +0000
Commit:     GitHub <noreply@github.com>
CommitDate: Wed Sep 22 15:38:49 2021 +0000

    Merge pull request os-autoinst#4215 from Martchus/concurrent-cleanup

    Allow configuring concurrent cleanup
# prevent multiple limit_* tasks to run in parallel
return $job->retry({delay => 60})
unless my $limit_guard = $app->minion->guard('limit_tasks', ONE_DAY);
return undef unless my $limit_guard = acquire_limit_lock_or_retry($job);
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the _limit subroutine has duplicate logic at multiple places. Would it make sense to define a common subroutine for all to which you just pass the argument for guard()?

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, it could likely be de-duplicated further.

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.

4 participants