Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.6.2, 2.7.4
Description
If collector throws http://collectorhost:port//ws/v1/timeline/metrics/livenodes 500 error then sink is unable to determine live/healthy collector.
sink will try to connect to another collector only if it is not reachable/IOException to first collector. if any other response code other than 200 then still it should consider as 1st Collector not reachable.
Possible fix
if (responseCode == 200) { try (InputStream in = connection.getInputStream()) { StringWriter writer = new StringWriter(); IOUtils.copy(in, writer); try { collectors = gson.fromJson(writer.toString(), new TypeToken<List<String>>(){}.getType()); } catch (JsonSyntaxException jse) { // Swallow this at the behest of still trying to POST LOG.debug("Exception deserializing the json data on live " + "collector nodes.", jse); } } } else if (responseCode == 500){ String warnMsg = "Unable to connect to collector to find live nodes, Internal server error"; throw new MetricCollectorUnavailableException(warnMsg); }