You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/01/10 23:48:59 UTC

[GitHub] [cassandra] jonmeredith opened a new pull request #1384: Reduce inbound internode connection authentication failure logging to INFO

jonmeredith opened a new pull request #1384:
URL: https://github.com/apache/cassandra/pull/1384


   It was noisy and unhelpful, log at INFO level instead..
   Also fixes the existing outbound test and adds a new inbound test.
   
   Patch by Jon Meredith; reviewed by ? for CASSANDRA-17068


-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra] jonmeredith closed pull request #1384: CASSANDRA-17068 Reduce inbound internode connection authentication failure logging to INFO

Posted by GitBox <gi...@apache.org>.
jonmeredith closed pull request #1384:
URL: https://github.com/apache/cassandra/pull/1384


   


-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra] dcapwell commented on a change in pull request #1384: Reduce inbound internode connection authentication failure logging to INFO

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1384:
URL: https://github.com/apache/cassandra/pull/1384#discussion_r783317900



##########
File path: src/java/org/apache/cassandra/transport/ConnectionLimitHandler.java
##########
@@ -44,10 +48,38 @@
 {
     private static final Logger logger = LoggerFactory.getLogger(ConnectionLimitHandler.class);
     private static final NoSpamLogger noSpamLogger = NoSpamLogger.getLogger(logger, 1L, TimeUnit.MINUTES);
+    private static final AttributeKey<InetAddress> addressAttributeKey = AttributeKey.valueOf(ConnectionLimitHandler.class, "address");
 
     private final ConcurrentMap<InetAddress, AtomicLong> connectionsPerClient = new ConcurrentHashMap<>();
     private final AtomicLong counter = new AtomicLong(0);
 
+    // Keep the remote address as a channel attribute.  The channel inactive callback needs
+    // to know the entry into the connetionsPerClient map and depending on the state of the remote
+    // an exception may be thrown trying to retrieve the address. Make sure the same address used
+    // to increment is used for decrement.
+    private static InetAddress setRemoteAddressAttribute(Channel channel)
+    {
+        Attribute<InetAddress> addressAttribute = channel.attr(addressAttributeKey);
+        SocketAddress remoteAddress = channel.remoteAddress();
+        if (remoteAddress instanceof InetSocketAddress)
+        {
+            addressAttribute.setIfAbsent(((InetSocketAddress) remoteAddress).getAddress());
+        }
+        else
+        {
+            noSpamLogger.warn("Remote address of unknown type: {}, skipping per-IP connection limits",
+                              remoteAddress.getClass());
+        }
+        return addressAttribute.get();
+    }
+
+    private static InetAddress getRemoteAddressAttribute(Channel channel)
+    {
+        Attribute<InetAddress> addressAttribute = channel.attr(addressAttributeKey);

Review comment:
       nit: `return channel.attr(addressAttributeKey).get()`

##########
File path: src/java/org/apache/cassandra/transport/ConnectionLimitHandler.java
##########
@@ -44,10 +48,38 @@
 {
     private static final Logger logger = LoggerFactory.getLogger(ConnectionLimitHandler.class);
     private static final NoSpamLogger noSpamLogger = NoSpamLogger.getLogger(logger, 1L, TimeUnit.MINUTES);
+    private static final AttributeKey<InetAddress> addressAttributeKey = AttributeKey.valueOf(ConnectionLimitHandler.class, "address");
 
     private final ConcurrentMap<InetAddress, AtomicLong> connectionsPerClient = new ConcurrentHashMap<>();
     private final AtomicLong counter = new AtomicLong(0);
 
+    // Keep the remote address as a channel attribute.  The channel inactive callback needs

Review comment:
       nit, `/** ... */`




-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra] jonmeredith commented on pull request #1384: CASSANDRA-17068 Reduce inbound internode connection authentication failure logging to INFO

Posted by GitBox <gi...@apache.org>.
jonmeredith commented on pull request #1384:
URL: https://github.com/apache/cassandra/pull/1384#issuecomment-1069665524


   Committed as 431c692b884395b16beadac1d10f7e674b3e7ed5


-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org