Project

General

Profile

Bug #6487

Avoid waiting on lock when calling yum

Added by Benoît PECCATTE about 5 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

Add --setopt=exit_on_lock=True to all yum calls


Subtasks

Bug #8376: Error messages about setopt in the inform output of the agentReleased2016-05-25Jonathan CLARKEActions

Related issues

Related to ncf - Bug #6488: Avoid waiting on lock when calling yumReleased2015-04-09Benoît PECCATTEActions
Related to ncf - Bug #8377: Error messages about setopt in the inform output of the agentReleased2016-05-25Jonathan CLARKEActions
Related to ncf - Bug #14235: Avoid checking for exit_on_lock option on newer yumReleasedNicolas CHARLESActions
#1

Updated by Nicolas CHARLES about 4 years ago

This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?

#2

Updated by Nicolas CHARLES about 4 years ago

  • Tags set to sponsored
#3

Updated by Jonathan CLARKE about 4 years ago

Nicolas CHARLES wrote:

This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?

According to http://illiterat.livejournal.com/8221.html the --setopt option was only introduced in RHEL 6.1's yum.

However, that option is just a wrapper to make it possible to change config values from yum.conf on the command line. So maybe we can set it via yum.conf (or a temporary yum.conf) before that version...

However, according to http://lists.baseurl.org/pipermail/yum-devel/2010-June/007087.html, it seems that the "exit_on_lock" option was only added after --setopt, so no.

But I have found a solution: yum versions without the --setopt option complain when it is used, and yum versions with it but when passed a specific option that is not in the main config, it complains too. So by running:

yum --setopt=exit_on_lock=True 2>&1 | grep -E "(Command line error: no such option: --setopt|Main config did not have a exit_on_lock attr. before setopt)" 

If the command returns 0, that means the option is not supported.

Note: this works even if yum's lock is already obtained, because there is no yum command (so the first command will return 1, and not even try to take the lock)

#4

Updated by François ARMAND about 4 years ago

  • Tags changed from Sponsored to Sponsored, Next minor release
#5

Updated by Benoît PECCATTE about 4 years ago

  • Related to Bug #6488: Avoid waiting on lock when calling yum added
#6

Updated by Benoît PECCATTE about 4 years ago

  • Target version set to 2.11.21
#7

Updated by Jonathan CLARKE about 4 years ago

Jonathan CLARKE wrote:

Nicolas CHARLES wrote:

This sounds pretty interesting !
However, on which version is it available?
https://bugzilla.redhat.com/show_bug.cgi?id=861250 seems to mention that RHEL6 has it, but maybe not first versions of RHEL ...
is there a way to detect if the feature exists ?

According to http://illiterat.livejournal.com/8221.html the --setopt option was only introduced in RHEL 6.1's yum.

However, that option is just a wrapper to make it possible to change config values from yum.conf on the command line. So maybe we can set it via yum.conf (or a temporary yum.conf) before that version...

However, according to http://lists.baseurl.org/pipermail/yum-devel/2010-June/007087.html, it seems that the "exit_on_lock" option was only added after --setopt, so no.

But I have found a solution: yum versions without the --setopt option complain when it is used, and yum versions with it but when passed a specific option that is not in the main config, it complains too. So by running:

[...]

If the command returns 0, that means the option is not supported.

Note: this works even if yum's lock is already obtained, because there is no yum command (so the first command will return 1, and not even try to take the lock)

Make sure to export LANG=C first so we don't have * localised error messages

#8

Updated by Nicolas CHARLES about 4 years ago

  • Assignee set to Nicolas CHARLES
#9

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from New to In progress
#10

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/939
#11

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
#12

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #8376: Error messages about setopt in the inform output of the agent added
#13

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #8377: Error messages about setopt in the inform output of the agent added
#14

Updated by Jonathan CLARKE about 4 years ago

  • Related to deleted (Bug #8376: Error messages about setopt in the inform output of the agent)
#15

Updated by Vincent MEMBRÉ almost 4 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.11.21, 3.0.16, 3.1.10 and 3.2.3 which were released on 2016-06-01, but not announced.

#16

Updated by Alexis MOUSSET over 1 year ago

  • Related to Bug #14235: Avoid checking for exit_on_lock option on newer yum added

Also available in: Atom PDF