2006-10-24 02:49:04

by NeilBrown

[permalink] [raw]
Subject: [PATCH 002 of 4] Make the initial RPC PING interruptible.


If an RPC client is created with CREATE_INTR and not CREATE_NOPING,
then the ping should be interruptible. With tcp the PING can take 30
seconds to time out and not being able to interrupt that can be
frustrating.

Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./net/sunrpc/clnt.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff .prev/net/sunrpc/clnt.c ./net/sunrpc/clnt.c
--- .prev/net/sunrpc/clnt.c 2006-10-24 09:41:49.000000000 +1000
+++ ./net/sunrpc/clnt.c 2006-10-24 09:43:48.000000000 +1000
@@ -221,7 +221,15 @@ struct rpc_clnt *rpc_create(struct rpc_c
return clnt;

if (!(args->flags & RPC_CLNT_CREATE_NOPING)) {
- int err = rpc_ping(clnt, RPC_TASK_SOFT|RPC_TASK_NOINTR);
+ int tskflags = RPC_TASK_SOFT;
+ int err;
+ if ( ! (args->flags & RPC_CLNT_CREATE_INTR))
+ tskflags |= RPC_TASK_NOINTR;
+ /* Note: we keep task_soft even if RPC_CLNT_CREATE_HARDRTRY
+ * is set. The whole point of the PING is to check that the
+ * server is there *now*
+ */
+ err = rpc_ping(clnt, tskflags);
if (err != 0) {
rpc_shutdown_client(clnt);
return ERR_PTR(err);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-10-24 23:19:34

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 002 of 4] Make the initial RPC PING interruptible.

What's the harm in always using SOFT|INTR for doing pings?

I would think this would be a bit cleaner if you just eliminated the
"flags" parameter of rpc_ping() and calculated the correct task flags
inside rpc_ping().

On 10/23/06, NeilBrown <[email protected]> wrote:
>
> If an RPC client is created with CREATE_INTR and not CREATE_NOPING,
> then the ping should be interruptible. With tcp the PING can take 30
> seconds to time out and not being able to interrupt that can be
> frustrating.
>
> Signed-off-by: Neil Brown <[email protected]>
>
> ### Diffstat output
> ./net/sunrpc/clnt.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff .prev/net/sunrpc/clnt.c ./net/sunrpc/clnt.c
> --- .prev/net/sunrpc/clnt.c 2006-10-24 09:41:49.000000000 +1000
> +++ ./net/sunrpc/clnt.c 2006-10-24 09:43:48.000000000 +1000
> @@ -221,7 +221,15 @@ struct rpc_clnt *rpc_create(struct rpc_c
> return clnt;
>
> if (!(args->flags & RPC_CLNT_CREATE_NOPING)) {
> - int err = rpc_ping(clnt, RPC_TASK_SOFT|RPC_TASK_NOINTR);
> + int tskflags = RPC_TASK_SOFT;
> + int err;
> + if ( ! (args->flags & RPC_CLNT_CREATE_INTR))
> + tskflags |= RPC_TASK_NOINTR;
> + /* Note: we keep task_soft even if RPC_CLNT_CREATE_HARDRTRY
> + * is set. The whole point of the PING is to check that the
> + * server is there *now*
> + */
> + err = rpc_ping(clnt, tskflags);
> if (err != 0) {
> rpc_shutdown_client(clnt);
> return ERR_PTR(err);
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> NFS maillist - [email protected]
> https://lists.sourceforge.net/lists/listinfo/nfs
>


--
"We who cut mere stones must always be envisioning cathedrals"
-- Quarry worker's creed

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-11-16 03:22:19

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 002 of 4] Make the initial RPC PING interruptible.

On Tuesday October 24, [email protected] wrote:
> What's the harm in always using SOFT|INTR for doing pings?
>
> I would think this would be a bit cleaner if you just eliminated the
> "flags" parameter of rpc_ping() and calculated the correct task flags
> inside rpc_ping().

Yes, that sounds right.

Thanks,

NeilBrown

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs