telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
65 stars 105 forks source link

[cygnus-ngsi][HDFSBackendImpl] Add certain Http responses as condition for changing host #1176

Closed frbattid closed 7 years ago

frbattid commented 7 years ago

Currently, the conditions for discarding the current host are based on catching exceptions when doing the Http request to the host. Nevertheless, there are certain successful connections that may lead to a host change as well, e.g. the following response sent by a Hadoop Namenode:

time=2016-09-22T09:21:55.789Z | lvl=DEBUG | corr=fee5a15c-80a5-11e6-ae09-fa163e6b2dc7 | trans=fec1b918-08c0-46d5-96a6-bda9cb58715b | srv=demo | subsrv=/electricidad | function=createJsonResponse | comp=Cygnus | msg=com.telefonica.iot.cygnus.backends.http.HttpBackend[297] : Http response payload: {"RemoteException":{"exception":"StandbyException","javaClassName":"org.apache.hadoop.ipc.StandbyException","message":"Operation category READ is not supported in state standby"}}

Current exception catching, even host iteration, are placed at HttpBackend. This should be moved to the particular backend implementation, cosidering both the exception or a response status as conditions for iterating to the next host.

frbattid commented 7 years ago

Fixed in PR https://github.com/telefonicaid/fiware-cygnus/pull/1177 (develop, cygnus-ngsi)) Fixed in PR https://github.com/telefonicaid/fiware-cygnus/pull/1181 (develop, cygnus-twitter) Fixed in PR https://github.com/telefonicaid/fiware-cygnus/pull/1179 (release/1.2.0, cygnus-ngsi, cygnus-twitter)