[LU-5095] HSM: Allow receiving messages to be non-blocking Created: 20/May/14  Updated: 29/Aug/14  Resolved: 10/Jul/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.6.0, Lustre 2.5.3

Type: Bug Priority: Major
Reporter: Patrick Farrell (Inactive) Assignee: Cliff White (Inactive)
Resolution: Fixed Votes: 0
Labels: HSM, patch

Severity: 3
Rank (Obsolete): 14041

 Description   

When using the HSM API for a copy tool, it's impossible to
properly exit an application because one thread might be
stuck in llapi_hsm_copytool_recv(), which in turn blocks
forever on a read.

So this patch expands the existing Lustre userspace HSM API
to be able to apply flags to the read side of the
communication pipe, so it can be opened with O_NONBLOCK,
and gives access to the pipe file descriptor used. (read side)

So now a program can do a poll/select, and then call
llapi_hsm_copytool_recv without blocking.

Notes: The flags passed in from the copy tool to
llapi_hsm_copytool_register are applied to the read side of
the pipe using fcntl, because we do not want to apply the
same flags to the read and write sides of the pipe.

No functionality is added for setting flags on the write
side of the pipe, since the kernel expects particular
behavior from that side of the pipe, and it seems unwise
to let user space modify it.

Additionally, this patch changes llapi_hsm_copytool_recv to
not return -EAGAIN when it finds a message for an archive
not serviced by that copytool.

Instead of returning -EAGAIN to the copy tool, which just
restarts the receive operation, this patch just loops inside
the recv function.

This is because this -EAGAIN conflicts with -EAGAIN
returned from the call to libcfs_ukuc_msg_get
which can occur when O_NONBLOCK is set.



 Comments   
Comment by Patrick Farrell (Inactive) [ 20/May/14 ]

Patch is here:
http://review.whamcloud.com/10393

Comment by Cliff White (Inactive) [ 06/Jun/14 ]

I will monitor this issue and patch.

Comment by Patrick Farrell (Inactive) [ 27/Jun/14 ]

Cliff,

I'd really like to see this patch landed for 2.6 if possible. Cray has had it in our Lustre tree for a few weeks now with no ill effects. I've invited Gatekeeper to take a look as well, but could you perhaps ask about it as well?

Comment by Cliff White (Inactive) [ 30/Jun/14 ]

It just was reviewed +1, I am asking and hopefully we will have it landed.

Comment by Cliff White (Inactive) [ 10/Jul/14 ]

Patch has been merged, I am closing this issue, please reopen if you have more concerns

Comment by James Nunez (Inactive) [ 24/Jul/14 ]

Patch for b2_5 is at http://review.whamcloud.com/#/c/11220/

Generated at Sat Feb 10 01:48:29 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.