support infinite locks using getl
Hello! I would like to implement PHP session storage with membase over the memcache extension, but have a requirement that lock expiry is greater than 29 seconds (sadly many PHP applications require long session locks in lieu of a queue service).
1. Are infinite timeouts practical? I'd like a lock to be released when the client's connection drops (in case of application crashes) - does the client keep an open connection for the duration of the lock?
2. If infinite timeouts are impractical could the maximum expiry time be increased to a greater value, perhaps ~200s, when it's explicitly set? I realise this could introduce backwards incompatibilities, perhaps a different method/parameter position for setting this timeout could be used?
1. Each lock doesn't know about the connection that was used to create it. If you had an infinite lock on a key and the client that locked the key went down then the keys would still be locked "infinitely". I put infinitely in quotes because Membase has the functionality to unlock locked keys, but the client would have to do this. So basically if you had an infinite lock you would just have to unlock it before it could ever be used again.
2. If we hear about more use cases for infinite locks we might implement them in the future. For now though we have added functionality to Membase 1.7 to allow the user to specify the default and max timeout for getl on the command line. If you want to change them you will have to replace the memcached executable with a custom shell script that provides the default memcached parameters used in Membase as well as the extra parameters for changing the default values of getl.