All of lore.kernel.org
 help / color / mirror / Atom feed
* pynfs clean_init issue
@ 2022-08-04 15:23 Chuck Lever III
  2022-08-04 15:38 ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever III @ 2022-08-04 15:23 UTC (permalink / raw)
  To: Bruce Fields; +Cc: Linux NFS Mailing List

Hi Bruce-

I'm running DELEG21 to unit-test delegations, and this message comes
out at the end:

Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY

I guess there's no callback service running during the test's clean-up phase.

Then if I run the test again immediately:

[cel@morisot pynfs]$ sudo nfs4.0/testserver.py manet:/export/tmp --maketree --rundeps -v cel
Initialization failed, no tests run.
Perhaps you need to use the --secure option or configure server to allow connections from high ports
Traceback (most recent call last):
  File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 394, in <module>
    main()
  File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 346, in main
    env.init()
  File "/home/cel/src/pynfs/nfs4.0/servertests/environment.py", line 150, in init
    c.clean_dir(self.opts.path)
  File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 579, in clean_dir
    check_result(res, "Making sure %s is writable" % repr(e.name))
  File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 906, in check_result
    raise BadCompoundRes(resop, res.status, msg)
nfs4lib.BadCompoundRes: Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY

And I think this condition persists until the old lease expires and
the server permits the client to delete that file.


--
Chuck Lever




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pynfs clean_init issue
  2022-08-04 15:23 pynfs clean_init issue Chuck Lever III
@ 2022-08-04 15:38 ` J. Bruce Fields
  2022-08-04 15:43   ` Chuck Lever III
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2022-08-04 15:38 UTC (permalink / raw)
  To: Chuck Lever III; +Cc: Linux NFS Mailing List

On Thu, Aug 04, 2022 at 03:23:44PM +0000, Chuck Lever III wrote:
> Hi Bruce-
> 
> I'm running DELEG21 to unit-test delegations, and this message comes
> out at the end:
> 
> Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY
> 
> I guess there's no callback service running during the test's clean-up phase.
> 
> Then if I run the test again immediately:
> 
> [cel@morisot pynfs]$ sudo nfs4.0/testserver.py manet:/export/tmp --maketree --rundeps -v cel
> Initialization failed, no tests run.
> Perhaps you need to use the --secure option or configure server to allow connections from high ports
> Traceback (most recent call last):
>   File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 394, in <module>
>     main()
>   File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 346, in main
>     env.init()
>   File "/home/cel/src/pynfs/nfs4.0/servertests/environment.py", line 150, in init
>     c.clean_dir(self.opts.path)
>   File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 579, in clean_dir
>     check_result(res, "Making sure %s is writable" % repr(e.name))
>   File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 906, in check_result
>     raise BadCompoundRes(resop, res.status, msg)
> nfs4lib.BadCompoundRes: Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY
> 
> And I think this condition persists until the old lease expires and
> the server permits the client to delete that file.

DELEG21 should pass on any recent kernel.

But possibly cleanup should also be better.  I'm not sure what the right
fix is.

--b.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pynfs clean_init issue
  2022-08-04 15:38 ` J. Bruce Fields
@ 2022-08-04 15:43   ` Chuck Lever III
  2022-08-04 18:14     ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever III @ 2022-08-04 15:43 UTC (permalink / raw)
  To: Bruce Fields; +Cc: Linux NFS Mailing List



> On Aug 4, 2022, at 11:38 AM, J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> On Thu, Aug 04, 2022 at 03:23:44PM +0000, Chuck Lever III wrote:
>> Hi Bruce-
>> 
>> I'm running DELEG21 to unit-test delegations, and this message comes
>> out at the end:
>> 
>> Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY
>> 
>> I guess there's no callback service running during the test's clean-up phase.
>> 
>> Then if I run the test again immediately:
>> 
>> [cel@morisot pynfs]$ sudo nfs4.0/testserver.py manet:/export/tmp --maketree --rundeps -v cel
>> Initialization failed, no tests run.
>> Perhaps you need to use the --secure option or configure server to allow connections from high ports
>> Traceback (most recent call last):
>>  File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 394, in <module>
>>    main()
>>  File "/home/cel/src/pynfs/nfs4.0/testserver.py", line 346, in main
>>    env.init()
>>  File "/home/cel/src/pynfs/nfs4.0/servertests/environment.py", line 150, in init
>>    c.clean_dir(self.opts.path)
>>  File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 579, in clean_dir
>>    check_result(res, "Making sure %s is writable" % repr(e.name))
>>  File "/home/cel/src/pynfs/nfs4.0/nfs4lib.py", line 906, in check_result
>>    raise BadCompoundRes(resop, res.status, msg)
>> nfs4lib.BadCompoundRes: Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY
>> 
>> And I think this condition persists until the old lease expires and
>> the server permits the client to delete that file.
> 
> DELEG21 should pass on any recent kernel.

It passes, but leaves the test file so that clean_dir does not work
again until the old lease expires.


> But possibly cleanup should also be better.

This bug might prevent running these tests in an automation harness.
I'd say cleanup does need to be better about this.


> I'm not sure what the right fix is.

Brute force: keep trying to delete that file if clean_dir receives
NFS4ERR_DELAY?

init_connection somewhere needs to set up a callback service and
leave it running.


--
Chuck Lever




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pynfs clean_init issue
  2022-08-04 15:43   ` Chuck Lever III
@ 2022-08-04 18:14     ` J. Bruce Fields
  2022-08-04 18:22       ` Chuck Lever III
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2022-08-04 18:14 UTC (permalink / raw)
  To: Chuck Lever III; +Cc: Linux NFS Mailing List

On Thu, Aug 04, 2022 at 03:43:56PM +0000, Chuck Lever III wrote:
> It passes, but leaves the test file so that clean_dir does not work
> again until the old lease expires.

Oh, right.

> > But possibly cleanup should also be better.
> 
> This bug might prevent running these tests in an automation harness.
> I'd say cleanup does need to be better about this.
> 
> > I'm not sure what the right fix is.
> 
> Brute force: keep trying to delete that file if clean_dir receives
> NFS4ERR_DELAY?

Delegations block unlinks too so that probably doesn't help.

> init_connection somewhere needs to set up a callback service and
> leave it running.

The callback isn't too important, I think, if we want to return the
delegation at the end of the test we can do that without waiting for the
server to remind us.

Or maybe destroy the client at the end.  We have no DESTROY_CLIENTID
(this is 4.0), but we could do a client-rebooting SETCLIENTID/CONFIRM to
wipe out its state.

There may be limits to the kind of cleanup pynfs can do.  A test harness
should probably reboot the server between test runs.

--b.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pynfs clean_init issue
  2022-08-04 18:14     ` J. Bruce Fields
@ 2022-08-04 18:22       ` Chuck Lever III
  0 siblings, 0 replies; 5+ messages in thread
From: Chuck Lever III @ 2022-08-04 18:22 UTC (permalink / raw)
  To: Bruce Fields; +Cc: Linux NFS Mailing List



> On Aug 4, 2022, at 2:14 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> On Thu, Aug 04, 2022 at 03:43:56PM +0000, Chuck Lever III wrote:
>> It passes, but leaves the test file so that clean_dir does not work
>> again until the old lease expires.
> 
> Oh, right.
> 
>>> But possibly cleanup should also be better.
>> 
>> This bug might prevent running these tests in an automation harness.
>> I'd say cleanup does need to be better about this.
>> 
>>> I'm not sure what the right fix is.
>> 
>> Brute force: keep trying to delete that file if clean_dir receives
>> NFS4ERR_DELAY?
> 
> Delegations block unlinks too so that probably doesn't help.

Just keep trying until the lease expires. But that's a naive
approach.


>> init_connection somewhere needs to set up a callback service and
>> leave it running.
> 
> The callback isn't too important, I think, if we want to return the
> delegation at the end of the test we can do that without waiting for the
> server to remind us.

That would help a lot, I think, and would not require an active
callback service on the client.

Btw, DELEG5 has the same problem... and btw, it's final OPEN fails
with EACCES... I'm looking into that too.


> Or maybe destroy the client at the end.  We have no DESTROY_CLIENTID
> (this is 4.0), but we could do a client-rebooting SETCLIENTID/CONFIRM to
> wipe out its state.

--
Chuck Lever




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-04 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 15:23 pynfs clean_init issue Chuck Lever III
2022-08-04 15:38 ` J. Bruce Fields
2022-08-04 15:43   ` Chuck Lever III
2022-08-04 18:14     ` J. Bruce Fields
2022-08-04 18:22       ` Chuck Lever III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.