Skip to content

Commit

Permalink
Fix RequestLoggerController concurrency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavr12 authored and mosiac1 committed Jan 21, 2025
1 parent da51b88 commit 97b4f9e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.common.base.Throwables;
import com.google.common.collect.EvictingQueue;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Queues;
import com.google.inject.Inject;
import io.airlift.log.Logger;
import io.trino.aws.proxy.server.TrinoAwsProxyConfig;
Expand Down Expand Up @@ -146,7 +147,7 @@ public static String eventId(Instant timestamp, long requestNumber, EventType ev
public RequestLoggerController(TrinoAwsProxyConfig trinoAwsProxyConfig)
{
// *2 because we log request/response
saveQueue = EvictingQueue.create(trinoAwsProxyConfig.getRequestLoggerSavedQty() * 2);
saveQueue = Queues.synchronizedQueue(EvictingQueue.create(trinoAwsProxyConfig.getRequestLoggerSavedQty() * 2));
saveQueueEnabled = (trinoAwsProxyConfig.getRequestLoggerSavedQty() > 0);
}

Expand Down

0 comments on commit 97b4f9e

Please sign in to comment.