[ 
https://issues.apache.org/jira/browse/GEODE-8687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240509#comment-17240509
 ] 

ASF GitHub Bot commented on GEODE-8687:
---------------------------------------

mkevo commented on a change in pull request #5730:
URL: https://github.com/apache/geode/pull/5730#discussion_r532377042



##########
File path: 
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQAutoSerializer.java
##########
@@ -0,0 +1,289 @@
+/*
+ * 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.geode.internal.cache.tier.sockets;
+
+import static org.apache.geode.cache.Region.SEPARATOR;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Objects;
+
+import com.google.common.collect.ImmutableMap;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientRegionFactory;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.cache.client.internal.PoolImpl;
+import org.apache.geode.cache.query.CqAttributesFactory;
+import org.apache.geode.cache.query.CqQuery;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.internal.cache.CacheServerImpl;
+import org.apache.geode.pdx.ReflectionBasedAutoSerializer;
+import org.apache.geode.pdx.internal.AutoSerializableManager;
+import org.apache.geode.test.dunit.Invoke;
+import org.apache.geode.test.dunit.rules.ClientVM;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
+import org.apache.geode.test.junit.categories.SerializationTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+@Category({ClientSubscriptionTest.class, SerializationTest.class})
+public class DurableClientCQAutoSerializer implements Serializable {

Review comment:
       Thanks Jakov!




----------------------------------------------------------------
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.

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


> Durable client is continuously re-registering CQs on all servers when event 
> de-serialization fails causing resource exhaustion on servers 
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-8687
>                 URL: https://issues.apache.org/jira/browse/GEODE-8687
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.13.0
>            Reporter: Jakov Varenina
>            Assignee: Jakov Varenina
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: deserialzationFault.log
>
>
> When ReflectionBasedAutoSerializer is wrongly/not set it results with 
> serialization exception on client at the reception of the CQ events. 
> Serialization exception isn't logged which is misleading, and is hard to find 
> that actually ReflectionBasedAutoSerializer isn't set correctly. Only log 
> that can be seen is that client/servers subscription connections are closed 
> due to EOF. This is because client destroys subscriptions connections 
> intentionally, but doesn't log reason (PdxSerializationException) that led to 
> this. It would be good that serialization exceptions are logged as error or 
> warn.
> Client destroys subscription connection and perform server fail-over whenever 
> serialization issue occurs. Additionally when subscription connection for 
> particular server fails multiple times then this server is put in deny list 
> for 10 seconds (this is configurable with {{ping-interval}}). After 10s 
> expire the server is removed from list and it is available for subscription 
> connection which will be destroyed again due serialization issue. This will 
> go indefinitely and approx. every 10s in this case the client subscribes to 
> each servers at least once. Due to serialization issue events aren't sent to 
> client and remain in subscription queues.
> Whenever connection fails due to serialization issue and client is not 
> durable then subscription queue is closed and events are lost.
> The biggest problem arises when client is durable. This is because 
> subscription queue remains on server for configurable period of time (e.g. 
> 300s) waiting for client to reconnect. When client perform fail-over to 
> another server it will create new subscription queue using initial image from 
> old queue that is currently paused. This means that all events from old queue 
> will be transferred to new subscription queue hosted by the current primary 
> server. This will happen on all servers and all of them will have copy of the 
> queue even subscription redundancy isn't configured. The problem here is that 
> client will periodically (every 10s in this case) establish connection to 
> each servers, so configured timeout (e.g. 300s) will never expire, but it 
> will be renewed each time client is registered. This could cause a lots of 
> problems since memory and disk usage (if overflow on queue is configured) 
> will increase on all servers.
> You can find in attached logs for the problematic case with durable client :
> vm0              -> locator
> vm1, vm2   -> servers
> vm3              -> durable client with enabled subscription handling CQ 
> events
> vm4              -> client generating traffic that should trigger registered 
> CQ
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to