Commit graph

30 commits

Author SHA1 Message Date
Preetha Appan 26d58865ab Make sure to call cancel on the context 2017-06-27 16:22:57 -05:00
Preetha Appan f04c0a7069 Made helper method for query options with context 2017-06-26 16:11:14 -05:00
Preetha Appan 82bf05c888 Fix socket file handle leaks from old blocking queries upon consul reload. This fixes issue #3018 2017-06-26 15:52:03 -05:00
James Phillips 4b85d33ef1 Fixes watch tracking during reloads and fixes address issue. (#3189)
This patch fixes watch registration through the config file and a broken log line when the watch registration fails. It also plumbs all the watch loading through a common function and tweaks the
unit test to create the watch before the reload.
2017-06-24 12:52:41 -07:00
James Phillips d8c21afa35 Merge pull request #2621 from alicebob/devwatch
reset watch's lastIndex on error
2017-06-02 09:06:02 -07:00
Frank Schroeder f50d6871f9 golint: No stutter 2017-04-25 09:26:13 -07:00
Frank Schroeder 9f8f258d4d Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
James Phillips fa5d3a81cd
Makes watcher test more robust. 2017-04-16 22:15:48 -07:00
Harmen bb41934230 reset the watch index when somehow the index goes backwards 2017-01-17 09:02:53 +01:00
Harmen 10cca4f9ca reset index to 0, not to 1 2017-01-17 09:02:49 +01:00
Harmen 0d550ff4b8 reset watch's lastIndex on error
When a -dev agent is restarted it'll have a clean state, including a
reset index. A watch() will reconnect after a restart, but it won't
notice that the index counter has reset and it will keep waiting until
we reached the old index again, which is wrong. Resetting the index will
prevent that and makes watch work for -dev agents.
2016-12-29 21:58:46 +01:00
James Phillips 9469b30e27
Moves stale code to same spot and adds it everywhere that supports it. 2016-08-10 15:49:51 -07:00
Evan Gilman bf2760ac18
Enable Stale mode for watchers
Solves https://github.com/hashicorp/consul/issues/917 by giving consul
watch a `-stale` flag
2016-05-10 00:09:15 -07:00
Sean Chittenden 65f9017c63 Update Check API to use constants
Use constants where appropriate to advocate their use.  Also add a deprecation notice re: `updateTTL`.
2016-04-23 16:01:59 -07:00
Ryan Uber 5172b21ee8 api: initial import from armon/consul-api 2015-01-06 10:40:00 -08:00
Emil Hessman 0222ed9eb9 Fix missing arguments 2014-11-01 22:56:48 +01:00
Armon Dadgar 175de542bc watch: Adding support for events 2014-08-28 15:41:06 -07:00
Armon Dadgar 4e3ca1a785 watch: Fixing bug with null keys 2014-08-21 17:24:20 -07:00
Armon Dadgar f82a38ab12 agent: First pass at agent-based watches 2014-08-21 13:09:13 -07:00
Armon Dadgar 47cb44683d watch: Remove DSL in place of JSON 2014-08-21 11:38:44 -07:00
Armon Dadgar d47c60daf4 watch: Set the ACL token 2014-08-20 16:45:37 -07:00
Armon Dadgar 19b55fab59 watch: support parameter exemption 2014-08-20 16:38:15 -07:00
Armon Dadgar b8a5089710 watch: support checks watch 2014-08-20 16:32:12 -07:00
Armon Dadgar 35cea1b30f watch: supporting service watch 2014-08-20 15:50:32 -07:00
Armon Dadgar 3884771895 watch: node watcher 2014-08-20 15:33:13 -07:00
Armon Dadgar e5cb913e54 watch: service watcher 2014-08-20 15:29:31 -07:00
Armon Dadgar 37a24878f0 watch: Support for key prefix 2014-08-20 15:22:22 -07:00
Armon Dadgar 07d36ec60a watch: test key watch 2014-08-20 15:18:08 -07:00
Armon Dadgar ffddd2b300 watch: Testing plan execution 2014-08-20 13:45:34 -07:00
Armon Dadgar bd89ff61ae watch: First pass at query parsing 2014-08-20 11:19:43 -07:00