cloudfoundry / cloudfoundry/cf-java-client
Exception handling on "API down for maintenance"
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 334
- 派生
- 319
- PR 合并指标
- 30 天内没有已合并 PR
描述
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?
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 Promregator issue、CAPI release notes 和 full-error.txt 开始,了解非 JSON 的维护响应以及由此产生的 CorruptedFrameException。该 issue 没有指出任何 repository 文件或测试;只有在项目确定该失败应归属何处,并定义预期的异常处理后,工作才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100