DESCRIPTION

Allow timeout to be set before multi ops

There has been frequent cases where async load ops fail with client side
timeout exceeded errors. Changes include increasing the default
timeout for multi ops to 5 seconds, however it could also be changed to a
custom value and using lock mode wait to support multithreading. Further
changes will follow to allow full multithreading support.

Change-Id: Ieafa0e2f5ecf06c4ec8e0251d3cc45c87701050c


COMMENTS

author: Marques Ellis
date: 2015-07-30 22:53:33.771000000

Uploaded patch set 1.

-------------------------------------
author: Hugo Blankenship
date: 2015-07-30 22:53:40.610000000

Patch Set 1:

Build Started http://factory.couchbase.com/job/testrunner-Jasmin Rangel-sherlock/5634/

-------------------------------------
author: Hugo Blankenship
date: 2015-07-30 23:28:36.239000000

Patch Set 1: Verified-1

Build Failed 

http://factory.couchbase.com/job/testrunner-Jasmin Rangel-sherlock/5634/ : FAILURE

detect lines like:

suite viewmergetests.ViewMergingTests , pass 38 , fail 1 ( http://factory.couchbase.com//job/testrunner-Jasmin Rangel-sherlock/5634/ )

need to update, install, or configure build tools, environment variables, ssh credentials (requires no code change) ( http://factory.couchbase.com//job/testrunner-Jasmin Rangel-sherlock/5634/ )

-------------------------------------
author: Quentin Ali
date: 2015-07-30 23:55:11.546000000

Patch Set 1:

Have u tested this?

-------------------------------------
author: Marques Ellis
date: 2015-07-31 17:49:41.203000000

Patch Set 1:

Hrm, I ran the sdk_client_tests .. let me check

-------------------------------------
author: Wyatt Kramer
date: 2015-07-31 18:11:45.044000000

Patch Set 1: Code-Review-2

(4 comments)

(1) You're still not locking the client (I see you might've intended to do so by importing threading. As it stands now, you risk clobbering the timeout value
(2) See inline - you should be recording the default timeout from the client itself, and not setting it to 0
(3) Much of the boilerplate wrt to checking timeouts can be done more eloquently by using decorators, xxx@xxx.xxx that should be able to automatically extract the 'timeout' parameter and run the appropriate function. This would make the diff much much smaller
(4) Don't use LOCKMODE_WAIT, use LOCKMODE_EXC (the default) with your own lock - this can guard both the timeout and concurrent ops

Line:15, lib/sdk_client.py -> Unused import?

Line:16, lib/sdk_client.py -> Unused import?

Line:72, lib/sdk_client.py -> Note that the durability timeout and the op timeout are different. The durability timeout essentially operates on two timeout values. The first is the op timeout which is done on a per-packet basis, and the second is the logical durability timeout -- how long the client waits until the criteria are satisfied.

Line:82, lib/sdk_client.py -> This sets the default timeout to 0. You should be recording the old timeout, not default_op_timeout. I believe you should be getting an exception if you try to use  a timeout of 0, but I'm not sure.

-------------------------------------
author: Marques Ellis
date: 2015-07-31 18:25:00.849000000

Removed the following votes:

* Verified-1 by Hugo Blankenship xxx@xxx.xxx


-------------------------------------
author: Marques Ellis
date: 2015-07-31 18:27:59.752000000

Patch Set 1:

(1 comment)

Line:51, lib/sdk_client.py -> The default timeout is not set to 0. It is set after the bucket object is created here. Yes decorator would have made it look nice. I'll submit another patch with that.

-------------------------------------
author: Tate Garrett
date: 2015-08-05 22:44:28.108000000

Change has been successfully cherry-picked as 0355851d371ef5ea025bf3d301d686187bd8cc00

-------------------------------------
