Commit Graph

22 Commits

Author SHA1 Message Date
James Bardin 3ff612d625 retry locks on network errors (#3553)
* retry locks on network errors

When communicating with a local agent and watching a lock, a dropped
connection between the agent and server will show up as a server error
and immediately be retried. However if the client is connected to a
remote server, a dropped connection immediately aborts the lock.

* Updates comment about it being unsafe for writes.
2017-10-11 07:42:10 -07:00
Frank Schroeder 9de4555c0c golint: Untangle if blocks with return in else 2017-04-25 09:26:13 -07:00
James Phillips 0f35f08b6a Adds comment about SessionOpts. 2016-10-05 17:53:27 -07:00
Maxim Ivanov d45b0cc68c More flexible Session configuration when using api.Lock 2016-09-29 14:07:54 +01:00
Seth Vargo dc9131a732 Use HTTPS + www. where appropriate 2016-01-13 17:44:01 -05:00
James Phillips dd4610e917 Factors server error checking into a new function. 2016-01-06 11:35:16 -08:00
James Phillips 6dd0835319 Makes the timeout behavior more intuitive.
Previously, it would try once "up to" the timeout, but in practice it would
just fall through. This modifies the behavior to block until the timeout has
been reached.
2016-01-06 09:40:20 -08:00
James Phillips 169825ed90 Adds the ability for semaphore monitors to ride out brief periods of 500 errors. 2016-01-05 18:22:36 -08:00
James Phillips 3348cf4c0b Adds "try" support to locks and semaphores. 2016-01-05 18:22:36 -08:00
James Phillips fcd0cb7a11 Adds custom retry time for lock monitors. 2015-11-30 20:16:22 -08:00
James Phillips 2f3d109b18 Adds a retry capability to lock monitors in the API client. 2015-11-30 17:09:41 -08:00
Tiru Srikantha 0184227828 Check to see why a lock acquisition failed 2015-06-05 13:23:23 -07:00
Michael Fraenkel 093b23d0c3 Reclaim locks
- When attempting to lock with the same session that already owns the lock,
  Lock() will re-acquire the lock.
2015-04-29 10:10:24 -07:00
Armon Dadgar de199d1fd6 api: Fixing some comments 2015-01-20 12:58:09 -08:00
Armon Dadgar 707b232274 api: Refactor to share session renew code 2015-01-19 16:53:47 -10:00
Armon Dadgar bed066dda9 api: Detect conflicting existing values for lock/semaphore 2015-01-19 15:32:19 -10:00
Armon Dadgar 1a6b160641 api: Make channels receive only 2015-01-19 14:37:36 -10:00
Armon Dadgar a12883a5be api: Adding Destroy to cleanup a lock 2015-01-13 14:01:50 -08:00
Armon Dadgar 654a292c89 api: Minor cleanups in lock 2015-01-12 17:43:13 -08:00
Armon Dadgar c597f191e3 api: Fixing typo 2015-01-12 15:46:40 -08:00
Armon Dadgar 02c2cc6e08 api: Fixing typos 2015-01-09 17:42:24 -08:00
Armon Dadgar 4e66d5407d api: Adding Lock helpers for leader election 2015-01-09 17:35:17 -08:00