googleapis / googleapis/google-cloud-java
[sdk-platform-java] fix: Modify existing mechanism of logging errors in gax-batching to avoid looped calls
- 主要语言
- Java
- 星标
- 2.1k
- 派生
- 1.2k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 157
描述
Existing error reporting mechanism in gax-batching uses JUL (`java.util.logger`) to log the errors. This mechanism can lead to the looped calls between the Java client logging library and gax in a case users configure the `com.google.cloud.logging.LoggingHandler` to serve as one of the JUL handlers. In such a case a call to write a log via JUL will land into gax-batching code (via java-logging). If an error arise, the gax-batching will call JUL to write an error log which, in turn, will return the flow back to the same gax-batching code.
To avoid such situation before the first call the current JUL handlers should be enumerated to ensure they do not include `com.google.cloud.logging.LoggingHandler`. If the latter occurs in the list, the error message should be logged to STDERR.
More info about batching modification can be found in the [internal document](http://go/cdpe-ops-log-writing-batching-in-java).
贡献指南
调研方向
首先跟踪 gax-batching 的错误报告路径及其对 JUL 的使用,然后检查 com.google.cloud.logging.LoggingHandler 如何出现在当前的 JUL handlers 中。完成的标准是:在首次调用之前检查现有 handlers,并且在该 handler 存在时将错误发送到 STDERR,从而避免递归的 logging 调用。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- observability-sre
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100