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

Returning errno "EINVAL" from Ofs plugin within XrdXrootdProtocol::do_Open() is translated to retryable error #1029

Closed
mpatrascoiu opened this issue Jul 29, 2019 · 1 comment
Assignees

Comments

@mpatrascoiu
Copy link
Contributor

When using an XrdOfs plugin, the file open call will be handed to the plugin Open function.
In case validation fails, the plugin should return a status code (e.g: SFS_ERROR), with more details in the XrdOucErrInfo error object.

For the following code (XrdXRootdXeq.cc::1393):

// Open the file
//
   if ((rc = fp->open(fn, (XrdSfsFileOpenMode)openopts,
                     (mode_t)mode, CRED, opaque)))
      {rc = fsError(rc, opC, fp->error, fn, opaque); return rc;}

Providing a status != 0 will trigger parsing of the error object.
The errno from the error object is translated in the XProtocol::mapError() function.
However, for EINVAL, it defaults to kXR_FSError, which is a retryable error.

The complementary XProtocol::toErrno() function provides a mapping between kXR_ArgInvalid/kXR_ArgMissing to EINVAL.

There's no benefit in retrying an EINVAL error from the open call.
Would be useful to have a mapping between EINVAL to a kXR_ error code.

@mpatrascoiu mpatrascoiu changed the title No translation provided from errno "EINVAL" to XErrorCode "kXR_Invalid" in XrdXrootdProtocol::do_Open() Returning errno "EINVAL" from Ofs plugin within XrdXrootdProtocol::do_Open() is translated to retryable error Jul 29, 2019
@abh3 abh3 self-assigned this Feb 18, 2020
@abh3
Copy link
Member

abh3 commented Feb 25, 2021

This was fixed by commit 43eb599 on January, 22, 2020. Sorry it took so long to report the fix but this one fell through the cracks.

@abh3 abh3 closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants