cloudfoundry / cloudfoundry/cf-java-client

Exception handling on "API down for maintenance"

Abierto
#964 5 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

enhancement triaged
Lenguaje dominante
Java
Estrellas
334
Forks
319
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Documented in the case of https://github.com/promregator/promregator/issues/96#issuecomment-490585118, Promregator (a consumer of cf-java-client) encountered the situation that the CF Cloud Controller did not respond with a proper response, but only returned the ASCII string

API down for maintenance

instead of the corresponding JSON.
I stumbled over https://github.com/cloudfoundry/capi-release/releases/tag/1.77.0, where the second line in the highlights suggests that this is a standard behavior of the platform (and also might have reported that error without providing the appropriate HTTP status code of 503).

Based on the logs, it seems that cf-java-client today reacts to just forward an exception of type io.netty.handler.codec.CorruptedFrameException. It is clear that the corresponding request cannot be fulfilled and some sort of error reporting/exception handling must take place in this case.

What is unclear to me is who should be in charge of handling such a kind of exception. I doubt that a consumer application should catch exceptions raised by netty due to a decoding issue. Moreover, the situation appears to be (perhaps not a desired situation, but still) a response that may happen from time to time. One may also argue whether this is covered by the contract.

What is your opinion about all this? Should the consumer of cf-java-client handle this kind of failure by catching io.netty.handler.codec.CorruptedFrameException?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el issue vinculado de Promregator, las CAPI release notes y full-error.txt para entender la respuesta de mantenimiento que no es JSON y la CorruptedFrameException resultante. El issue no menciona archivos del repositorio ni pruebas; el trabajo solo está completo cuando el proyecto decide dónde corresponde este fallo y define el manejo esperado de la excepción.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.