Commit Graph

33 Commits

Author SHA1 Message Date
Hadar Greinsmark 7e1a860978 Implement HTTP Watch handler (#3413)
Implement HTTP Watch handler
2017-10-21 20:39:09 -05:00
Preetha Appan 36acf8d6a4 Use new DeletePrefixMethod for implementing KVSDeleteTree operation. This makes deletes on sub trees larger than one million nodes about 100 times faster. Added unit tests. 2017-07-25 17:21:18 -05:00
James Phillips 8d0a048408 Expands and rework context support in the API client. (#3273) 2017-07-14 17:30:08 -07:00
Preetha Appan d25be8671a Make sure to call cancel on the context 2017-06-27 16:22:57 -05:00
Preetha Appan a6c3cf0403 Made helper method for query options with context 2017-06-26 16:11:14 -05:00
Preetha Appan 9eaf56bfe3 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 6977e40077 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 5f9776ac89 Merge pull request #2621 from alicebob/devwatch
reset watch's lastIndex on error
2017-06-02 09:06:02 -07:00
Frank Schroeder d7e23857ad golint: No stutter 2017-04-25 09:26:13 -07:00
Frank Schroeder eddb1af603 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 d9e6f3c894
Makes watcher test more robust. 2017-04-16 22:15:48 -07:00
Harmen d7b5f41447 reset the watch index when somehow the index goes backwards 2017-01-17 09:02:53 +01:00
Harmen 021cc2017d reset index to 0, not to 1 2017-01-17 09:02:49 +01:00
Harmen 4a13cafa98 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 888f27de2b
Moves stale code to same spot and adds it everywhere that supports it. 2016-08-10 15:49:51 -07:00
Evan Gilman 965fcf9d6b
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 e63d3a1275 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 5555e0eb9b api: initial import from armon/consul-api 2015-01-06 10:40:00 -08:00
Emil Hessman c9333b1b9b Fix missing arguments 2014-11-01 22:56:48 +01:00
Armon Dadgar e13ba2f2da watch: Adding support for events 2014-08-28 15:41:06 -07:00
Armon Dadgar 94615b0b7e watch: Fixing bug with null keys 2014-08-21 17:24:20 -07:00
Armon Dadgar 4b547a43d0 agent: First pass at agent-based watches 2014-08-21 13:09:13 -07:00
Armon Dadgar ad40ddf361 watch: Remove DSL in place of JSON 2014-08-21 11:38:44 -07:00
Armon Dadgar ee4a1a960f watch: Set the ACL token 2014-08-20 16:45:37 -07:00
Armon Dadgar 723352fc37 watch: support parameter exemption 2014-08-20 16:38:15 -07:00
Armon Dadgar 5aefdf01a0 watch: support checks watch 2014-08-20 16:32:12 -07:00
Armon Dadgar f3c8873009 watch: supporting service watch 2014-08-20 15:50:32 -07:00
Armon Dadgar 8d70128761 watch: node watcher 2014-08-20 15:33:13 -07:00
Armon Dadgar 00358baa7f watch: service watcher 2014-08-20 15:29:31 -07:00
Armon Dadgar 970c606f1a watch: Support for key prefix 2014-08-20 15:22:22 -07:00
Armon Dadgar 68a829119e watch: test key watch 2014-08-20 15:18:08 -07:00
Armon Dadgar 66edf0075a watch: Testing plan execution 2014-08-20 13:45:34 -07:00
Armon Dadgar 2b07355b94 watch: First pass at query parsing 2014-08-20 11:19:43 -07:00