-
Notifications
You must be signed in to change notification settings - Fork 39
Description
google-cloud-logging enables the blocking flow controller in the GAX batching library, going to lengths to modify the default gapic behavior:
java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java
Lines 168 to 181 in 7b3928e
| BatchingSettings oldBatchSettings = | |
| logBuilder.writeLogEntriesSettings().getBatchingSettings(); | |
| logBuilder | |
| .writeLogEntriesSettings() | |
| .setBatchingSettings( | |
| oldBatchSettings | |
| .toBuilder() | |
| .setFlowControlSettings( | |
| oldBatchSettings | |
| .getFlowControlSettings() | |
| .toBuilder() | |
| .setLimitExceededBehavior(LimitExceededBehavior.Block) | |
| .build()) | |
| .build()); |
The trouble with the blocking batch flow controller is that it can block LoggingImpl.writeAsync and thus any application code that happens to log after the flow controller is full. (That can happen either because of too much application logging or because of a slow-down in the logging service.) Preferable behavior would be dropping the log messages that cannot be uploaded and leaving a note about dropped messages in the next batch or stderr.
(This issue is notwithstanding a recent regression described in #632. That regression occludes the problematic behavior described here by removing the GAX batcher.)