Skip to content

Commit c2a75c8

Browse files
out_azure_kusto: Add comments & logs for cleanup
Signed-off-by: ag-ramachandran <ramacg@microsoft.com>
1 parent f270724 commit c2a75c8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

plugins/out_azure_kusto/azure_kusto_conf.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,17 @@ int azure_kusto_load_ingestion_resources(struct flb_azure_kusto *ctx,
614614
parse_ingestion_identity_token(ctx, response);
615615

616616
if (identity_token) {
617-
/* Deferred cleanup: destroy resources from two refresh cycles ago,
618-
* then move current resources to 'old' before assigning new ones.
619-
* This avoids use-after-free when other threads may still be using
620-
* the current resources during high-volume operations. */
617+
/*
618+
Deferred cleanup: destroy resources from two refresh cycles ago,
619+
then move current resources to 'old' before assigning new ones.
620+
This avoids use-after-free when other threads may still be using
621+
the current resources during high-volume operations.
622+
623+
With a 1-hour refresh interval, the race condition requires an
624+
ingest operation to take >1 hour (the deferred cleanup grace period).
625+
This is extremely unlikely under normal conditions (and hence a lock based
626+
mechanism is avoided for performance).
627+
*/
621628
if (ctx->resources->old_blob_ha) {
622629
flb_upstream_ha_destroy(ctx->resources->old_blob_ha);
623630
flb_plg_debug(ctx->ins, "clearing up old blob HA");
@@ -642,6 +649,9 @@ int azure_kusto_load_ingestion_resources(struct flb_azure_kusto *ctx,
642649
ctx->resources->identity_token = identity_token;
643650
ctx->resources->load_time = now;
644651

652+
flb_plg_info(ctx->ins, "ingestion resources rotated successfully, "
653+
"previous resources moved to deferred cleanup");
654+
645655
ret = 0;
646656
}
647657
else {

0 commit comments

Comments
 (0)