apache-curator

Notifying an instance as down using a ServiceCache in Curator


The documentation for Curator (http://curator.apache.org/curator-x-discovery/index.html) says:

If a particular instance has an I/O error, etc. you should call ServiceProvider.noteError() passing in the instance.

I am using a ServiceCache to get my instances, rather than a ServiceProvider (see Using selection strategies with a cache in Curator).

Where can I find the noteError() method here? I can't find it on the cache object


Solution

  • There is no noteError() on a ServiceCache, however as @Randgalt notes (https://stackoverflow.com/a/57059811/2048051) the best way is to not use a ServiceCache but rather just use ServiceProvider, because in the background that uses a cache anyway, and it has the noteError() method available.

    https://issues.apache.org/jira/browse/CURATOR-531 has been raised to make the documentation clearer