Frank Filz has uploaded this change for review.

View Change

DRC: Better handle duplicate requests while a request is in progress

The old code would drop any duplicate request while the original
request was still in progress, assuming that the response would be
sent. Unfortunately, if a TCP connection is broken while the request
is in progress, sending the response fails. The client never retries
and gets stuck.

Now when this occurs, we queue up the request and suspend it (utlizing
the async infrastructure). When the original request processing
completes and calls nfs_dupreq_finish() we track if there was an error
sending the response. If so, we don't mark the DRC entry as complete
and instead resume the first retry to attempt to send the response.

That resumed retry will call nfs_dupreq_finish() after it tries to
send the response, so if there is a queue of retries, there are more
opportunities to re-send a failed response.

The same retry logic is followed when nfs_dupreq_delete() is called
if there are again queued duplicate requests, however, those retries
instead are re-submitted for a new attempt to process. This logic
occurs when there is an NFS_DROP result from a retryable error or
an auth error.

Once the request is succesfully completed, any additional queued
requests are dropped.

We limit the queue to 3 duplicates. That should be more than enough
to get through an issue like this unless the server has severely
stalled out on the original request.

Change-Id: Ia1d207aefdddb6845987856c9f1073b2f7167e94
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
---
M src/MainNFSD/nfs_rpc_dispatcher_thread.c
M src/MainNFSD/nfs_worker_thread.c
M src/RPCAL/nfs_dupreq.c
M src/include/nfs_dupreq.h
M src/include/nfs_proto_data.h
M src/include/nfs_proto_functions.h
6 files changed, 372 insertions(+), 159 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/35/528935/1

To view, visit change 528935. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ia1d207aefdddb6845987856c9f1073b2f7167e94
Gerrit-Change-Number: 528935
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx@mindspring.com>
Gerrit-MessageType: newchange