Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modify existing mechanism of logging errors in gax-batching to avoid looped calls #1317

Open
minherz opened this issue Nov 1, 2021 · 1 comment
Labels
gax lang: java Issues specific to Java. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@minherz
Copy link

minherz commented Nov 1, 2021

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.

@minherz minherz added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. lang: java Issues specific to Java. labels Nov 1, 2021
@minherz minherz self-assigned this Nov 1, 2021
@chanseokoh
Copy link
Contributor

After talking to @vam-google, I learned that gax-batching is not the only place where gax-java does logging. Places I found:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gax lang: java Issues specific to Java. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants