Skip to content

Commit

Permalink
Fix setters for native_transport_max_concurrent_requests_in_bytes and…
Browse files Browse the repository at this point in the history
… native_transport_max_concurrent_requests_in_bytes_per_ip
  • Loading branch information
ekaterinadimitrova2 committed Apr 2, 2022
1 parent f32d2b0 commit a8f64cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -6,6 +6,7 @@
* Validate existence of DCs when repairing (CASSANDRA-17407)
* dropping of a materialized view creates a snapshot with dropped- prefix (CASSANDRA-17415)
Merged from 3.0:
* Fix setters for native_transport_max_concurrent_requests_in_bytes and native_transport_max_concurrent_requests_in_bytes_per_ip (CASSANDRA-17515)
* Suppress CVE-2021-44521 (CASSANDRA-17492)
* ConnectionLimitHandler may leaks connection count if remote connection drops (CASSANDRA-17252)
* Require ant >= 1.10 (CASSANDRA-17428)
Expand Down
6 changes: 6 additions & 0 deletions src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Expand Up @@ -1934,6 +1934,9 @@ public static long getNativeTransportMaxConcurrentRequestsInBytesPerIp()

public static void setNativeTransportMaxConcurrentRequestsInBytesPerIp(long maxConcurrentRequestsInBytes)
{
if (maxConcurrentRequestsInBytes <= 0)
maxConcurrentRequestsInBytes = Runtime.getRuntime().maxMemory() / 40;

conf.native_transport_max_concurrent_requests_in_bytes_per_ip = maxConcurrentRequestsInBytes;
}

Expand All @@ -1944,6 +1947,9 @@ public static long getNativeTransportMaxConcurrentRequestsInBytes()

public static void setNativeTransportMaxConcurrentRequestsInBytes(long maxConcurrentRequestsInBytes)
{
if (maxConcurrentRequestsInBytes <= 0)
maxConcurrentRequestsInBytes = Runtime.getRuntime().maxMemory() / 10;

conf.native_transport_max_concurrent_requests_in_bytes = maxConcurrentRequestsInBytes;
}

Expand Down

0 comments on commit a8f64cb

Please sign in to comment.