Bug 1288143

Summary: tuna thows an exception instead of an error message when sched_setaffinity returns EINVAL
Product: Red Hat Enterprise Linux 6 Reporter: Guy Streeter <streeter>
Component: tunaAssignee: John Kacur <jkacur>
Status: CLOSED ERRATA QA Contact: Jiri Kastner <jkastner>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: bhu, dvacek, jkastner, jshortt, kzhang, nobody
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1290445 (view as bug list) Environment:
Last Closed: 2016-05-10 20:53:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1270066, 1290445    
Attachments:
Description Flags
proposed fix
none
proposed fix none

Comment 6 John Kacur 2015-12-10 14:30:52 UTC
Created attachment 1104366 [details]
proposed fix

Comment 7 John Kacur 2015-12-10 14:36:49 UTC
I've tested this and it works, but will wait for upstream comments before using it for a build

Comment 8 Guy Streeter 2015-12-10 15:13:40 UTC
I think a slightly more detailed error message would be good. Mention the affected thread by name and/or PID, since the command may have tried to move more than one thread.

And, "thread cannot be moved as requested" is clearer than "cannot move thread" for this condition.
--Guy

Comment 9 John Kacur 2015-12-15 01:46:12 UTC
I mostly agree, although, "thread cannot be moved as requested", is not clearer because it sounds like it could be moved if you requested it differently. Wordier is not always clearer, it leaves room for more arguments. Anyway, I think this discussion belongs on the tuna mailing list and not on the bugzilla.

Comment 10 Guy Streeter 2015-12-15 15:07:37 UTC
But we don't know from the error whether requesting it differently would have succeeded. How about "failed to move thread"?

Comment 11 John Kacur 2015-12-15 15:51:43 UTC
How about, "Cannot move unmovable thread (%pid)"

Comment 12 Guy Streeter 2015-12-15 15:54:46 UTC
You can get EINVAL when a thread is movable, but not as requested. You can also get EINVAL when the thread is unmovable.
I think "do not move" or "failed to move" is better.

Comment 13 John Kacur 2015-12-15 16:37:12 UTC
Good point.
Going back to your original suggestion, how about the following?

# tuna --cpus=1 --threads="migration/*" --move
thread 11 cannot be moved as requested
thread 28 cannot be moved as requested
thread 21 cannot be moved as requested


--------------------------

Note that it is simple to get the pid, but the thread name is a bit trickier, so I suggest we leave that as a feature for the future.

Comment 14 Guy Streeter 2015-12-15 16:57:57 UTC
That looks good to me.

Comment 15 John Kacur 2015-12-15 17:04:38 UTC
Created attachment 1106091 [details]
proposed fix

Comment 16 John Kacur 2015-12-17 11:26:10 UTC
Fixed in tuna-0.12-2.el6 and up

Comment 21 errata-xmlrpc 2016-05-10 20:53:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0807.html