Skip to content

blocking batch flow control belies async logging #701

Closed
@benjaminp

Description

@benjaminp

google-cloud-logging enables the blocking flow controller in the GAX batching library, going to lengths to modify the default gapic behavior:

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.)

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/java-logging API.lang: javaIssues specific to Java.type: processA process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions