linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Commit which exposes blocked tasks with NFSv4.0 and Kerberos
@ 2018-06-24 20:30 Armin Größlinger
  2018-06-24 20:56 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Armin Größlinger @ 2018-06-24 20:30 UTC (permalink / raw)
  To: linux-nfs

Hello NFS developers,

I've written to this list before [1],[2] concerning uninterruptible hung
tasks in clients using NFSv4.0 with Kerberos. I have also written
scripts (which can be cloned from [3]) which help to reproduce the hangs
by configuring two virtual machines with the required setup and a test
program which triggers the hangs rather quickly (see [2] for details).

Meanwhile, I have been able to do some bisecting of kernel sources to
find a commit which exposes the hangs. It seems that since commit

2aca5b869ace67a63aab895659e5dc14c33a4d6e
SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT

(introduced with v3.18-rc1) the uninterruptible hangs occur. When I
revert this commit, then I do not observe the uninterruptible hangs.
I've tested this on Ubuntu 16.04's 4.4 kernel and Debian 9's 4.9 kernel
and several stock kernels.

In our group at the university, we have about 15 desktop machines and 70
nodes in a SLURM cluster. Without reverting the commit, we've had on
average one machine per day locking up with uninterruptible hanging
tasks reported by the kernel; for about 6 weeks, we now run only kernels
with the commit reverted (i.e., Debian/Ubuntu's kernel recompiled after
reverting the patch) and we have not had any NFS-related machine lockups
so far.

I'm not claiming that the mentioned commit is the cause of the problem;
I think it exposes the problem. The problem is also present in current
kernels. Unfortunately, there seems to be another problem which can be
triggered by my test program from [3]. Since commit

9b30889c548a4d45bfe6226e58de32504c1d682f
SUNRPC: Ensure we always close the socket after a connection shuts down

(introduced with v4.16-rc1) is is very likely that the system dies due
to an out of memory condition, i.e., at some point the kernel consumes
all the memory and the OOM killer kills all user processes. When this
commit is reverted, I can observe the uninterruptible hung tasks again
(with kernel up to 4.18-rc2).

Since I have no expertise in the NFS client implementation, I'm still
hoping that exports on this list have an idea how to fix the NFS
client's behavior.

Regards,
Armin



[1] https://marc.info/?l=linux-nfs&m=150620442017672

[2] https://marc.info/?l=linux-nfs&m=152396752525579

[3] https://gitlab.infosun.fim.uni-passau.de/groessli/nfs-krb5-vms


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

* Re: Commit which exposes blocked tasks with NFSv4.0 and Kerberos
  2018-06-24 20:30 Commit which exposes blocked tasks with NFSv4.0 and Kerberos Armin Größlinger
@ 2018-06-24 20:56 ` Trond Myklebust
  2018-06-25 20:51   ` Armin Größlinger
  0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2018-06-24 20:56 UTC (permalink / raw)
  To: linux-nfs, armin.groesslinger

T24gU3VuLCAyMDE4LTA2LTI0IGF0IDIyOjMwICswMjAwLCBBcm1pbiBHcsO2w59saW5nZXIgd3Jv
dGU6DQo+IEhlbGxvIE5GUyBkZXZlbG9wZXJzLA0KPiANCj4gSSd2ZSB3cml0dGVuIHRvIHRoaXMg
bGlzdCBiZWZvcmUgWzFdLFsyXSBjb25jZXJuaW5nIHVuaW50ZXJydXB0aWJsZQ0KPiBodW5nDQo+
IHRhc2tzIGluIGNsaWVudHMgdXNpbmcgTkZTdjQuMCB3aXRoIEtlcmJlcm9zLiBJIGhhdmUgYWxz
byB3cml0dGVuDQo+IHNjcmlwdHMgKHdoaWNoIGNhbiBiZSBjbG9uZWQgZnJvbSBbM10pIHdoaWNo
IGhlbHAgdG8gcmVwcm9kdWNlIHRoZQ0KPiBoYW5ncw0KPiBieSBjb25maWd1cmluZyB0d28gdmly
dHVhbCBtYWNoaW5lcyB3aXRoIHRoZSByZXF1aXJlZCBzZXR1cCBhbmQgYQ0KPiB0ZXN0DQo+IHBy
b2dyYW0gd2hpY2ggdHJpZ2dlcnMgdGhlIGhhbmdzIHJhdGhlciBxdWlja2x5IChzZWUgWzJdIGZv
cg0KPiBkZXRhaWxzKS4NCj4gDQo+IE1lYW53aGlsZSwgSSBoYXZlIGJlZW4gYWJsZSB0byBkbyBz
b21lIGJpc2VjdGluZyBvZiBrZXJuZWwgc291cmNlcyB0bw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lnYXRpb24gdG8gcmVwbHkgdG8gdGhlIGNsaWVudCdzIFJQQyBjYWxsIChhcyBz
cGVsbGVkIG91dCBpbiB0aGUNCmFib3ZlIHNlY3Rpb24gb2YgdGhlIHNwZWMpLg0KDQotLSANClRy
b25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFpbmVyLCBIYW1tZXJzcGFjZQ0K
dHJvbmQubXlrbGVidXN0QGhhbW1lcnNwYWNlLmNvbQ0KDQo=

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

* Re: Commit which exposes blocked tasks with NFSv4.0 and Kerberos
  2018-06-24 20:56 ` Trond Myklebust
@ 2018-06-25 20:51   ` Armin Größlinger
  0 siblings, 0 replies; 3+ messages in thread
From: Armin Größlinger @ 2018-06-25 20:51 UTC (permalink / raw)
  To: linux-nfs

On Sun, 2018-06-24 at 22:56, Trond Myklebust wrote:
> On Sun, 2018-06-24 at 22:30 +0200, Armin Größlinger wrote:
>> Meanwhile, I have been able to do some bisecting of kernel sources to
>> find a commit which exposes the hangs. It seems that since commit
>>
>> 2aca5b869ace67a63aab895659e5dc14c33a4d6e
>> SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT
>>
>> (introduced with v3.18-rc1) the uninterruptible hangs occur. When I
>> revert this commit, then I do not observe the uninterruptible hangs.
>> I've tested this on Ubuntu 16.04's 4.4 kernel and Debian 9's 4.9
>> kernel
>> and several stock kernels.
> 
> That's the patch that implements this part of the NFSv4 spec:
>  https://tools.ietf.org/html/rfc7530#section-3.1.1

I don't think the commit I referred to is the problem,
I think it exposes the underlying problem.

> So are you seeing the connection break when these hangs occur?

Sometimes the server (with Debian's 4.9.88 kernel) logs

[  194.473842] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shuttting down socket

but not always when the hang occurs. Is there another way to check if
the connection is "broken"?

> If the
> connection hasn't broken, then the problem is more likely to be the
> server silently dropping requests, and hence failing to meet the
> obligation to reply to the client's RPC call (as spelled out in the
> above section of the spec).

Initially (in our group at the university) we observed the problem with
a Nexenta NFS server. I could not reproduce the problem with a FreeBSD
server. In addition, the problem seems to be very timing sensitive: it
occurs less when our Nexenta server under a heavier load and I cannot
reproduce it with my test VMs when I disable KVM acceleration (so the
VMs run 2-5 times slower).

I now tried also with Linux 4.18-rc2 as NFS server (instead of 4.9.88
from Debian Stretch) and then I could not observe the hanging tasks on
the client but the test program seems to "pause" for 30-120 seconds
every few iterations (and continues after the pause). After 2.5 hours,
the 2 GB RAM of the client were almost completely consumed by the kernel
(i.e., commands on the shell failed with "cannot fork: Cannot allocate
memory"), so there seems to be a memory leak?

With 4.18-rc2 as NFS client, I still see the OOM killer killing all
processes a few seconds after starting my test program (as mentioned in
my previous email).

With 4.18-rc2 as NFS server, I see many messages like

[ 1098.832570] rpc-srv/tcp: nfsd: got error -104 when sending 232 bytes
- shutting down socket
[ 1137.164829] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1211.284693] rpc-srv/tcp: nfsd: got error -104 when sending 232 bytes
- shutting down socket
[ 1236.512956] rpc-srv/tcp: nfsd: got error -104 when sending 232 bytes
- shutting down socket
[ 1258.140792] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1299.744482] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1372.608731] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1376.272594] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1376.412361] rpc-srv/tcp: nfsd: sent only 204 when sending 232 bytes -
shutting down socket
[ 1386.340604] rpc-srv/tcp: nfsd: got error -104 when sending 232 bytes
- shutting down socket
[ 1406.828262] rpc-srv/tcp: nfsd: got error -32 when sending 232 bytes -
shutting down socket

on the server (but the client keeps running - with 30-120 second pauses
mentioned above) and the port of the NFS connection changes frequently
(every few seconds).

I'm not sure what to try next and whether to blame the server or the
client for the misbehavior.

Regards,
Armin



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

end of thread, other threads:[~2018-06-25 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-24 20:30 Commit which exposes blocked tasks with NFSv4.0 and Kerberos Armin Größlinger
2018-06-24 20:56 ` Trond Myklebust
2018-06-25 20:51   ` Armin Größlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).