简体   繁体   中英

CosmosDB Java V4 SDK executeBulkOperations - "Main sink completion failed. EmitResult: FAIL_TERMINATED"

If I run a simple set of document updates on the CosmosDB container using container.executeBulkOperations(bulkOperations) I'm getting strange suspicious log messages from the underlying Cosmos DB Java SDK V4 like:

...lementation.batch.BulkExecutor:862 - Closing all sinks, Context: BulkExecutor-1[n/a]
...lementation.batch.BulkExecutor:862 - Closing all sinks, Context: BulkExecutor-1[n/a]
...lementation.batch.BulkExecutor:869 - Main sink completion failed. EmitResult: FAIL_TERMINATED, Context: BulkExecutor-1[n/a]
...lementation.batch.BulkExecutor:862 - Closing all sinks, Context: BulkExecutor-1[n/a]
...lementation.batch.BulkExecutor:869 - Main sink completion failed. EmitResult: FAIL_TERMINATED, Context: BulkExecutor-1[n/a]

Should I terminate the bulk operations somehow explicitly? What am I doing wrong? Or should I ignore such log messages as they are at INFO level?

Sample code:

    public static final String PARTITION_ID = "BULK_DATA_PARTITION";
    @Inject
    @CosmosBalConfiguration.BalBalancesContainer
    CosmosAsyncContainer container;

    record IdAndPartition(String id, String partitionId){};

    void simpleDummyBulkUpdate() {

        Flux<CosmosItemOperation> bulkOperations = Flux.range(0, 10).map(i -> CosmosBulkOperations.getUpsertItemOperation(new IdAndPartition(i.toString(), PARTITION_ID), new PartitionKey(PARTITION_ID)));
        container.executeBulkOperations(bulkOperations)
                .blockLast();
    }

This is just a noisy log that currently generates an INFO level log. Thanks for your feedback, the team is using it to reduce the log level in cases where the bulk operation completed successfully (sink was completed).

Reference: https://github.com/Azure/azure-sdk-for-java/pull/32601#pullrequestreview-1217306057

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM