Bug 1773339 - tuna raises TypeError exception
Summary: tuna raises TypeError exception
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tuna
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jiri Kastner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-17 18:42 UTC by Georg Sauthoff
Modified: 2020-05-30 03:51 UTC (History)
3 users (show)

Fixed In Version: tuna-0.14.1-1.fc32 tuna-0.14.1-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-30 01:53:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fix OSError related TypeErrors and a sys.stderr usage (10.60 KB, patch)
2019-11-17 19:05 UTC, Georg Sauthoff
no flags Details | Diff

Description Georg Sauthoff 2019-11-17 18:42:26 UTC
Description of problem:
When moving as many kernel threads as possible tuna now raises a TypeError exception for a command that worked before in Fedora 29.


Version-Release number of selected component (if applicable):
tuna-0.14-3.fc31.noarch

How reproducible:
always

Steps to Reproduce:
1. tuna -U -t '*' -c 0-4 -m
2.
3.

Actual results:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/tuna/tuna.py", line 202, in move_threads_to_cpu
    schedutils.set_affinity(pid, new_affinity)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/tuna", line 711, in <module>
    main()
  File "/usr/bin/tuna", line 593, in main
    spread = spread)
  File "/usr/lib/python3.7/site-packages/tuna/tuna.py", line 205, in move_threads_to_cpu
    if e[0] == errno.ESRCH:
TypeError: 'OSError' object is not subscriptable

Expected results:
Some warnings regarding non-movable threads, but otherwise no such exception and tuna moves as many threads as possible while continuing after each warning.


Additional info:

Comment 1 Georg Sauthoff 2019-11-17 19:05:28 UTC
Created attachment 1637120 [details]
Fix OSError related TypeErrors and a sys.stderr usage

Quick-fix for this issue, tested it under Fedora 31.

Comment 2 Georg Sauthoff 2020-04-30 19:08:06 UTC
Is this package unmaintained?

Comment 3 Jiri Kastner 2020-04-30 20:45:04 UTC
maintained :)
thanks for patch will try on other archs, platforms

Comment 4 Damian Wrobel 2020-05-20 11:11:19 UTC
I wanted to use tuna instead of taskset and was hit by the same issue:

$ sudo tuna -t rcu* -c 0 -m

produces the following output:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/tuna/tuna.py", line 202, in move_threads_to_cpu
    schedutils.set_affinity(pid, new_affinity)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/tuna", line 711, in <module>
    main()
  File "/usr/bin/tuna", line 593, in main
    spread = spread)
  File "/usr/lib/python3.7/site-packages/tuna/tuna.py", line 205, in move_threads_to_cpu
    if e[0] == errno.ESRCH:
TypeError: 'OSError' object is not subscriptable

$ rpm -qv tuna python3-ethtool python3-linux-procfs python3-schedutils
tuna-0.14-3.fc31.noarch
python3-ethtool-0.14-3.fc31.x86_64
python3-linux-procfs-0.6.1-3.fc31.noarch
python3-schedutils-0.6-8.fc31.x86_64

Comment 5 Fedora Update System 2020-05-21 06:51:27 UTC
FEDORA-2020-53dfeb2b9c has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-53dfeb2b9c

Comment 6 Fedora Update System 2020-05-21 06:52:00 UTC
FEDORA-2020-04b1a3f536 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-04b1a3f536

Comment 7 Fedora Update System 2020-05-21 06:52:29 UTC
FEDORA-2020-0d813bbe3f has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-0d813bbe3f

Comment 8 Fedora Update System 2020-05-22 03:02:09 UTC
FEDORA-2020-04b1a3f536 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-04b1a3f536`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-04b1a3f536

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-05-22 04:23:43 UTC
FEDORA-2020-53dfeb2b9c has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-53dfeb2b9c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-53dfeb2b9c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2020-05-22 04:54:31 UTC
FEDORA-2020-0d813bbe3f has been pushed to the Fedora 30 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-0d813bbe3f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-0d813bbe3f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-05-30 01:53:54 UTC
FEDORA-2020-53dfeb2b9c has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2020-05-30 03:51:07 UTC
FEDORA-2020-04b1a3f536 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.