You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "deepthi912 (via GitHub)" <gi...@apache.org> on 2025/03/20 20:35:30 UTC

[PR] Fix Direct Memory OOM on Server [pinot]

deepthi912 opened a new pull request, #15335:
URL: https://github.com/apache/pinot/pull/15335

   **Context:** Some expensive queries from broker caused servers to go into OOM state causing the consuming segments to stop consumption and we had to increase the direct max memory on the servers and do a manual restart inorder to mitigate the issue. The channels on the Request handler from broker seems to be taking up most of the space for large queries. 
   
   ```
   ERROR [InstanceRequestHandler] [nioEventLoopGroup-3-20] Unhandled Exception in org.apache.pinot.core.transport.InstanceRequestHandler
   java.lang.OutOfMemoryError: Cannot reserve 4194304 bytes of direct buffer memory (allocated: 5364982965, limit: 5368709120)
           at java.base/java.nio.Bits.reserveMemory(Bits.java:178) ~[?:?]
           at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:111) ~[?:?]
           at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:360) ~[?:?]
           at
   ```
   
   Closing these active channels when OOM is caused because of all the buffer allocations from broker, releasing the channel and freeing up the space. Reference for broker OOM fix: https://github.com/apache/pinot/pull/11496


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2010704030


##########
pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java:
##########
@@ -132,6 +132,8 @@ public enum ServerMeter implements AbstractMetrics.Meter {
   TOTAL_THREAD_CPU_TIME_MILLIS("millis", false),
   LARGE_QUERY_RESPONSE_SIZE_EXCEPTIONS("exceptions", false),
 
+  DIRECT_MEMORY_OOM("directMemoryOOMCount", true),

Review Comment:
   We are updating it in DirectOOMServerHandler exceptionCaught method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2771487196

   Idea: instead (or maybe complementary) of trying to free Netty's memory when we are getting out of it... could we try to limit the amount of memory being used by Netty? By default Netty's pools consume 2/3 of the offheap memory, which is fine for normal apps that don't use offheap memory theirself but probably is too much for us. This can be tuned by system properties but also using allocators with explicit memory limits. See https://github.com/netty/netty/blob/a785e5b3d1e11a40fa61757c7a119333ad459c20/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java#L69


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2035254482


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/DirectOOMServerHandler.java:
##########
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.transport;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.socket.ServerSocketChannel;
+import io.netty.channel.socket.SocketChannel;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.pinot.common.metrics.ServerMeter;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Handling netty direct memory OOM. In this case there is a great chance that servers are receiving requests from
+ * broker concurrently that needs lot of scans on server pusing servers to OOM. We want to close all channels to broker
+ * to proactively release the direct memory.
+ */
+public class DirectOOMServerHandler extends ChannelInboundHandlerAdapter {
+  private static final Logger LOGGER = LoggerFactory.getLogger(DirectOOMServerHandler.class);
+  private static final AtomicBoolean OOM_SHUTTING_DOWN = new AtomicBoolean(false);
+
+  private final ConcurrentHashMap<SocketChannel, Boolean> _allChannels;
+  private volatile boolean _silentShutDown = false;
+  private ServerSocketChannel _serverSocketChannel;
+
+  public DirectOOMServerHandler(ConcurrentHashMap<SocketChannel, Boolean> allChannels,
+      ServerSocketChannel serverSocketChannel) {
+    _allChannels = allChannels;
+    _serverSocketChannel = serverSocketChannel;
+  }
+
+  public void setSilentShutDown() {
+    _silentShutDown = true;
+  }
+
+  /**
+   * Closes and removes all active channels from the map to release direct memory.
+   */
+  private void closeAllChannels() {
+    LOGGER.warn("OOM detected: Closing all channels to release direct memory");
+    for (SocketChannel channel : _allChannels.keySet()) {
+      try {
+        channel.close();
+      } catch (Exception e) {
+        LOGGER.error("Error while closing channel: {}", channel, e);
+      } finally {
+        _allChannels.remove(channel);
+      }
+    }
+  }
+
+  void setSilentShutdown() {
+    if (_serverSocketChannel != null) {
+      DirectOOMServerHandler directOOMHandler = _serverSocketChannel.pipeline().get(DirectOOMServerHandler.class);
+      if (directOOMHandler != null) {
+        directOOMHandler.setSilentShutDown();
+      }
+    }
+  }
+
+  @Override
+  public void channelInactive(ChannelHandlerContext ctx) {
+    // if we are shutting down channels due to direct memory OOM, we short circuit the channel inactive
+    if (_silentShutDown) {
+      return;
+    }
+    ctx.fireChannelInactive();
+  }
+
+  @Override
+  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+    if (cause instanceof OutOfMemoryError && cause.getMessage().contains("direct buffer")) {
+      ServerMetrics.get().addMeteredGlobalValue(ServerMeter.DIRECT_MEMORY_OOM, 1L);
+      // Only one thread should handle OOM
+      if (OOM_SHUTTING_DOWN.compareAndSet(false, true)) {
+        try {
+          LOGGER.error("Direct memory OOM detected. Closing all channels to free up memory.", cause);
+          closeAllChannels();
+          setSilentShutdown();
+        } catch (Exception e) {
+          LOGGER.error("Error while handling direct memory OOM", e);
+        } finally {
+          OOM_SHUTTING_DOWN.set(false);
+        }

Review Comment:
   Added a silent shutdown specific to each channel OOM Handler.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2010712060


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/DirectOOMServerHandler.java:
##########
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.transport;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.socket.ServerSocketChannel;
+import io.netty.channel.socket.SocketChannel;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.pinot.common.metrics.ServerMeter;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Handling netty direct memory OOM. In this case there is a great chance that servers are receiving requests from
+ * broker concurrently that needs lot of scans on server pusing servers to OOM. We want to close all channels to broker
+ * to proactively release the direct memory.
+ */
+public class DirectOOMServerHandler extends ChannelInboundHandlerAdapter {
+  private static final Logger LOGGER = LoggerFactory.getLogger(DirectOOMServerHandler.class);
+  private static final AtomicBoolean OOM_SHUTTING_DOWN = new AtomicBoolean(false);
+
+  private final ConcurrentHashMap<SocketChannel, Boolean> _allChannels;
+  private volatile boolean _silentShutDown = false;
+  private ServerSocketChannel _serverSocketChannel;
+
+  public DirectOOMServerHandler(ConcurrentHashMap<SocketChannel, Boolean> allChannels,
+      ServerSocketChannel serverSocketChannel) {
+    _allChannels = allChannels;
+    _serverSocketChannel = serverSocketChannel;
+  }
+
+  public void setSilentShutDown() {
+    _silentShutDown = true;
+  }
+
+  /**
+   * Closes and removes all active channels from the map to release direct memory.
+   */
+  private void closeAllChannels() {
+    LOGGER.warn("OOM detected: Closing all channels to release direct memory");
+    for (SocketChannel channel : _allChannels.keySet()) {
+      try {
+        channel.close();
+      } catch (Exception e) {
+        LOGGER.error("Error while closing channel: {}", channel, e);
+      } finally {
+        _allChannels.remove(channel);
+      }
+    }
+  }
+
+  void setSilentShutdown() {
+    if (_serverSocketChannel != null) {
+      DirectOOMServerHandler directOOMHandler = _serverSocketChannel.pipeline().get(DirectOOMServerHandler.class);
+      if (directOOMHandler != null) {
+        directOOMHandler.setSilentShutDown();
+      }
+    }
+  }
+
+  @Override
+  public void channelInactive(ChannelHandlerContext ctx) {
+    // if we are shutting down channels due to direct memory OOM, we short circuit the channel inactive
+    if (_silentShutDown) {
+      return;
+    }
+    ctx.fireChannelInactive();
+  }
+
+  @Override
+  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+    if (cause instanceof OutOfMemoryError && cause.getMessage().contains("direct buffer")) {

Review Comment:
   The error message I saw was direct buffer so tried to check for the same. On safer side, added .toLowerCase() here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2037547484


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/DirectOOMHandler.java:
##########
@@ -63,25 +73,63 @@ public void channelInactive(ChannelHandlerContext ctx) {
     ctx.fireChannelInactive();
   }
 
+  /**
+   * Closes and removes all active channels from the map to release direct memory.
+   */
+  private void closeAllChannels() {
+    LOGGER.warn("OOM detected: Closing all channels to release direct memory");
+    for (SocketChannel channel : _allChannels.keySet()) {
+      try {
+        setSilentShutdown(channel);
+        LOGGER.info("Closing channel: {}", channel);
+        if (channel != null) {
+          channel.close();
+        }
+      } catch (Exception e) {
+        LOGGER.error("Error while closing channel: {}", channel, e);
+      } finally {
+        _allChannels.remove(channel);
+      }
+    }
+  }
+
+  // silent shutdown for the channels without firing channelInactive
+  private void setSilentShutdown(SocketChannel socketChannel) {
+    if (socketChannel != null) {
+      DirectOOMHandler directOOMHandler = socketChannel.pipeline().get(DirectOOMHandler.class);
+      if (directOOMHandler != null) {
+        directOOMHandler.setSilentShutDown();
+      }
+    }
+  }
+
   @Override
-  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
     // catch direct memory oom here
-    if (cause instanceof OutOfMemoryError
-        && StringUtils.containsIgnoreCase(cause.getMessage(), "direct buffer")) {
-      BrokerMetrics.get().addMeteredGlobalValue(BrokerMeter.DIRECT_MEMORY_OOM, 1L);
+    if (cause instanceof OutOfMemoryError && StringUtils.containsIgnoreCase(cause.getMessage(), "direct buffer")) {
       // only one thread can get here and do the shutdown
       if (DIRECT_OOM_SHUTTING_DOWN.compareAndSet(false, true)) {
         try {
-          LOGGER.error("Closing ALL channels to servers, as we are running out of direct memory "
-              + "while receiving response from {}", _serverRoutingInstance, cause);
-          // close all channels to servers
-          _serverToChannelMap.keySet().forEach(serverRoutingInstance -> {
-            ServerChannels.ServerChannel removed = _serverToChannelMap.remove(serverRoutingInstance);
-            removed.closeChannel();
-            removed.setSilentShutdown();
-          });
-          _queryRouter.markServerDown(_serverRoutingInstance,
-              new QueryCancelledException("Query cancelled as broker is out of direct memory"));
+          if (_serverToChannelMap != null && !_serverToChannelMap.isEmpty()) {
+            LOGGER.error("Closing ALL channels to servers, as we are running out of direct memory "
+                + "while receiving response from {}", _serverRoutingInstance, cause); // broker side direct OOM handler
+            BrokerMetrics.get().addMeteredGlobalValue(BrokerMeter.DIRECT_MEMORY_OOM, 1L);
+
+            // close all channels to servers
+            _serverToChannelMap.keySet().forEach(serverRoutingInstance -> {
+              ServerChannels.ServerChannel removed = _serverToChannelMap.remove(serverRoutingInstance);
+              removed.closeChannel();
+              removed.setSilentShutdown();
+            });
+            _queryRouter.markServerDown(_serverRoutingInstance,
+                new QueryCancelledException("Query cancelled as broker is out of direct memory"));
+          } else if (_allChannels != null && !_allChannels.isEmpty()) { // server side direct OOM handler
+            LOGGER.error("Closing channel from broker, as we are running out of direct memory "
+                + "while initiating request to server", cause);
+            cause.printStackTrace();

Review Comment:
   [nitpick] Consider removing 'cause.printStackTrace()' and rely solely on logger.error to log the exception, ensuring consistent logging in production code.
   ```suggestion
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2785664932

   Thanks @gortiz  for pointing this out, we can tune this memory allocated to direct buffers. On that note, I am thinking to assign 1/5th instead of 2/3rd of the offheap memory in two of the places where we are allocating PooledByteBufAllocator on broker & server side..


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2741689710

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/15335?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `36.17021%` with `30 lines` in your changes missing coverage. Please review.
   > Project coverage is 56.01%. Comparing base [(`59551e4`)](https://app.codecov.io/gh/apache/pinot/commit/59551e45224f1535c4863fd577622b37366ccc97?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`78f6a70`)](https://app.codecov.io/gh/apache/pinot/commit/78f6a70e352f262d8a35eda5c4386c60c11498c3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 1884 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/15335?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...e/pinot/core/transport/DirectOOMServerHandler.java](https://app.codecov.io/gh/apache/pinot/pull/15335?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Ftransport%2FDirectOOMServerHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS90cmFuc3BvcnQvRGlyZWN0T09NU2VydmVySGFuZGxlci5qYXZh) | 23.07% | [29 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/pinot/pull/15335?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   > :exclamation:  There is a different number of reports uploaded between BASE (59551e4) and HEAD (78f6a70). Click for more details.
   > 
   > <details><summary>HEAD has 48 uploads less than BASE</summary>
   >
   >| Flag | BASE (59551e4) | HEAD (78f6a70) |
   >|------|------|------|
   >|integration|7|0|
   >|integration2|3|0|
   >|temurin|12|2|
   >|java-21|7|2|
   >|skip-bytebuffers-true|3|1|
   >|skip-bytebuffers-false|7|1|
   >|unittests|5|2|
   >|java-11|5|0|
   >|unittests2|3|0|
   >|integration1|2|0|
   >|custom-integration1|2|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #15335      +/-   ##
   ============================================
   - Coverage     61.75%   56.01%   -5.75%     
   - Complexity      207      685     +478     
   ============================================
     Files          2436     2175     -261     
     Lines        133233   117321   -15912     
     Branches      20636    18753    -1883     
   ============================================
   - Hits          82274    65712   -16562     
   - Misses        44911    46212    +1301     
   + Partials       6048     5397     -651     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <36.17%> (-5.62%)` | :arrow_down: |
   | [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.96% <36.17%> (-5.78%)` | :arrow_down: |
   | [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.96% <36.17%> (+28.23%)` | :arrow_up: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <36.17%> (-5.75%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <36.17%> (-5.74%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <36.17%> (+9.11%)` | :arrow_up: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/15335/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/15335?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary>🚀 New features to boost your workflow: </summary>
   
   - ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - 📦 [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2010710648


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java:
##########
@@ -138,6 +144,9 @@ protected void initChannel(SocketChannel ch) {
               ch.pipeline().addLast(ChannelHandlerFactory.getLengthFieldBasedFrameDecoder());
               ch.pipeline().addLast(ChannelHandlerFactory.getLengthFieldPrepender());
               ch.pipeline().addLast(_instanceRequestHandler);
+              ch.closeFuture().addListener(future -> {
+                _allChannels.remove(ch);

Review Comment:
   They are closed, just made sure there are no channels that are present in _allChannels when they get closed. I can also remove this actually since I am anyway handling it in DirectOOMServerHandler



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2010670961


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/DirectOOMServerHandler.java:
##########
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.transport;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.socket.ServerSocketChannel;
+import io.netty.channel.socket.SocketChannel;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.pinot.common.metrics.ServerMeter;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Handling netty direct memory OOM. In this case there is a great chance that servers are receiving requests from
+ * broker concurrently that needs lot of scans on server pusing servers to OOM. We want to close all channels to broker
+ * to proactively release the direct memory.
+ */
+public class DirectOOMServerHandler extends ChannelInboundHandlerAdapter {
+  private static final Logger LOGGER = LoggerFactory.getLogger(DirectOOMServerHandler.class);
+  private static final AtomicBoolean OOM_SHUTTING_DOWN = new AtomicBoolean(false);
+
+  private final ConcurrentHashMap<SocketChannel, Boolean> _allChannels;
+  private volatile boolean _silentShutDown = false;
+  private ServerSocketChannel _serverSocketChannel;
+
+  public DirectOOMServerHandler(ConcurrentHashMap<SocketChannel, Boolean> allChannels,
+      ServerSocketChannel serverSocketChannel) {
+    _allChannels = allChannels;
+    _serverSocketChannel = serverSocketChannel;
+  }
+
+  public void setSilentShutDown() {
+    _silentShutDown = true;
+  }
+
+  /**
+   * Closes and removes all active channels from the map to release direct memory.
+   */
+  private void closeAllChannels() {
+    LOGGER.warn("OOM detected: Closing all channels to release direct memory");
+    for (SocketChannel channel : _allChannels.keySet()) {
+      try {
+        channel.close();
+      } catch (Exception e) {
+        LOGGER.error("Error while closing channel: {}", channel, e);
+      } finally {
+        _allChannels.remove(channel);
+      }
+    }
+  }
+
+  void setSilentShutdown() {
+    if (_serverSocketChannel != null) {
+      DirectOOMServerHandler directOOMHandler = _serverSocketChannel.pipeline().get(DirectOOMServerHandler.class);
+      if (directOOMHandler != null) {
+        directOOMHandler.setSilentShutDown();
+      }
+    }
+  }
+
+  @Override
+  public void channelInactive(ChannelHandlerContext ctx) {
+    // if we are shutting down channels due to direct memory OOM, we short circuit the channel inactive
+    if (_silentShutDown) {
+      return;
+    }
+    ctx.fireChannelInactive();
+  }
+
+  @Override
+  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+    if (cause instanceof OutOfMemoryError && cause.getMessage().contains("direct buffer")) {

Review Comment:
   should this be 'Direct buffer', cross-checking with that broker side fix PR?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on code in PR #15335:
URL: https://github.com/apache/pinot/pull/15335#discussion_r2010013239


##########
pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java:
##########
@@ -132,6 +132,8 @@ public enum ServerMeter implements AbstractMetrics.Meter {
   TOTAL_THREAD_CPU_TIME_MILLIS("millis", false),
   LARGE_QUERY_RESPONSE_SIZE_EXCEPTIONS("exceptions", false),
 
+  DIRECT_MEMORY_OOM("directMemoryOOMCount", true),

Review Comment:
   It doesn't look like this metric is being updated in this PR



##########
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java:
##########
@@ -138,6 +144,9 @@ protected void initChannel(SocketChannel ch) {
               ch.pipeline().addLast(ChannelHandlerFactory.getLengthFieldBasedFrameDecoder());
               ch.pipeline().addLast(ChannelHandlerFactory.getLengthFieldPrepender());
               ch.pipeline().addLast(_instanceRequestHandler);
+              ch.closeFuture().addListener(future -> {
+                _allChannels.remove(ch);

Review Comment:
   Aren't these channels closed once the socket channel is closed anyway?



##########
pinot-core/src/main/java/org/apache/pinot/core/transport/DirectOOMServerHandler.java:
##########
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.transport;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.socket.ServerSocketChannel;
+import io.netty.channel.socket.SocketChannel;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.pinot.common.metrics.ServerMeter;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Handling netty direct memory OOM. In this case there is a great chance that servers are receiving requests from
+ * broker concurrently that needs lot of scans on server pusing servers to OOM. We want to close all channels to broker
+ * to proactively release the direct memory.
+ */
+public class DirectOOMServerHandler extends ChannelInboundHandlerAdapter {
+  private static final Logger LOGGER = LoggerFactory.getLogger(DirectOOMServerHandler.class);
+  private static final AtomicBoolean OOM_SHUTTING_DOWN = new AtomicBoolean(false);
+
+  private final ConcurrentHashMap<SocketChannel, Boolean> _allChannels;
+  private volatile boolean _silentShutDown = false;
+  private ServerSocketChannel _serverSocketChannel;
+
+  public DirectOOMServerHandler(ConcurrentHashMap<SocketChannel, Boolean> allChannels,
+      ServerSocketChannel serverSocketChannel) {
+    _allChannels = allChannels;
+    _serverSocketChannel = serverSocketChannel;
+  }
+
+  public void setSilentShutDown() {
+    _silentShutDown = true;
+  }
+
+  /**
+   * Closes and removes all active channels from the map to release direct memory.
+   */
+  private void closeAllChannels() {
+    LOGGER.warn("OOM detected: Closing all channels to release direct memory");
+    for (SocketChannel channel : _allChannels.keySet()) {
+      try {
+        channel.close();
+      } catch (Exception e) {
+        LOGGER.error("Error while closing channel: {}", channel, e);
+      } finally {
+        _allChannels.remove(channel);
+      }
+    }
+  }
+
+  void setSilentShutdown() {
+    if (_serverSocketChannel != null) {
+      DirectOOMServerHandler directOOMHandler = _serverSocketChannel.pipeline().get(DirectOOMServerHandler.class);
+      if (directOOMHandler != null) {
+        directOOMHandler.setSilentShutDown();
+      }
+    }
+  }
+
+  @Override
+  public void channelInactive(ChannelHandlerContext ctx) {
+    // if we are shutting down channels due to direct memory OOM, we short circuit the channel inactive
+    if (_silentShutDown) {
+      return;
+    }
+    ctx.fireChannelInactive();
+  }
+
+  @Override
+  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+    if (cause instanceof OutOfMemoryError && cause.getMessage().contains("direct buffer")) {
+      ServerMetrics.get().addMeteredGlobalValue(ServerMeter.DIRECT_MEMORY_OOM, 1L);
+      // Only one thread should handle OOM
+      if (OOM_SHUTTING_DOWN.compareAndSet(false, true)) {
+        try {
+          LOGGER.error("Direct memory OOM detected. Closing all channels to free up memory.", cause);
+          closeAllChannels();
+          setSilentShutdown();
+        } catch (Exception e) {
+          LOGGER.error("Error while handling direct memory OOM", e);
+        } finally {
+          OOM_SHUTTING_DOWN.set(false);
+        }

Review Comment:
   What happens with new request once this code is fired? It looks to me that this handler is kept in the pipeline, so we will add new channels into _allChannels, right? But then _silentShutdown is kept as true forever. That sounds incorrect, although I may not be correctly understanding the flow



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2800825514

   > Thanks @gortiz for pointing this out, we can tune this memory allocated to direct buffers. On that note, I am thinking to assign 1/5th of unused offheap mem instead of 2/3rd of the total offheap memory in two of the places where we are allocating PooledByteBufAllocator on broker & server side. Any comments on that?
   
   I think it is a good idea to create a new configuration option to let users decide how much memory will be used. Right now it can be done but only setting env/system variables.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "deepthi912 (via GitHub)" <gi...@apache.org>.
deepthi912 commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2749513216

   @klsince I agree with your point especially on the server side, there is risk of not solving the OOM problem when let's say ingestion is happening on the table when it's trying to commit the segment, in the http client request is trying to [fake_table2__0__0__20250324T2154Z] Exception while in work
   java.lang.OutOfMemoryError: Cannot reserve 8192 bytes of direct buffer memory (allocated: 1042334, limit: 1048576)
   	at java.base/java.nio.Bits.reserveMemory(Bits.java:178) ~[?:?]
   	at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:111) ~[?:?]
   	at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:360) ~[?:?]
   	at java.base/sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:242) ~[?:?]
   	at java.base/sun.nio.ch.NioSocketImpl.tryRead(NioSocketImpl.java:253) ~[?:?]
   	at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:274) ~[?:?]
   	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304) ~[?:?]
   	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346) ~[?:?]
   	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796) ~[?:?]
   	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099) ~[?:?]
   	at org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:149) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.core5.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:250) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.core5.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:56) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:331) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:196) ~[httpcore5-5.3.3.jar:5.3.3]
   	at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.lambda$execute$0(InternalExecRuntime.java:236) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:791) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:233) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:120) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:198) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:150) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:174) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:106) ~[httpclient5-5.4.2.jar:5.4.2]
   	at org.apache.pinot.common.utils.http.HttpClient.sendRequest(HttpClient.java:297) ~[classes/:?]
   	at org.apache.pinot.common.utils.FileUploadDownloadClient.sendSegmentCompletionProtocolRequest(FileUploadDownloadClient.java:1191) ~[classes/:?]
   	at org.apache.pinot.server.realtime.ServerSegmentCompletionProtocolHandler.sendRequest(ServerSegmentCompletionProtocolHandler.java:227) ~[classes/:?]
   	at org.apache.pinot.server.realtime.ServerSegmentCompletionProtocolHandler.segmentConsumed(ServerSegmentCompletionProtocolHandler.java:194) ~[classes/:?]
   	at org.apache.pinot.core.data.manager.realtime.RealtimeSegmentDataManager.postSegmentConsumedMsg(RealtimeSegmentDataManager.java:1348) ~[classes/:?]
   	at org.apache.pinot.core.data.manager.realtime.RealtimeSegmentDataManager$PartitionConsumer.run(RealtimeSegmentDataManager.java:787) ~[classes/:?]
   	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
   2025/03/24 14:54:55.254 ERROR [ServerSegmentCompletionProtocolHandler] [fake_table2__1__0__20250324T2154Z] Could not send request http://100.81.52.104:9000/segmentStoppedConsuming?reason=java.lang.OutOfMemoryError&streamPartitionMsgOffset=250&instance=Server_100.81.52.104_8098&name=fake_table2__1__0__20250324T2154Z


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2748925301

   is it safe to recover the server process from the OOM error here? To my knowledge, it's usually not a good idea (e.g. https://stackoverflow.com/questions/3058198/can-the-jvm-recover-from-an-outofmemoryerror-without-a-restart). It's usually better/cleaner to just fail the process fast and let it restart. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 merged PR #15335:
URL: https://github.com/apache/pinot/pull/15335


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Fix Direct Memory OOM on Server [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #15335:
URL: https://github.com/apache/pinot/pull/15335#issuecomment-2744622459

   Is there a way to refactor this and #11496 to simplify the DirectOOMHandler implementation?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org