[
https://issues.apache.org/jira/browse/GEODE-8036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17095940#comment-17095940
]
ASF GitHub Bot commented on GEODE-8036:
---------------------------------------
jdeppe-pivotal edited a comment on pull request #5015:
URL: https://github.com/apache/geode/pull/5015#issuecomment-621504482
I'm not sure whether this was meant to solve GEODE-7998, but here is a test
that reproduces the original issue:
```java
@Test
public void testPubSubWithManyClientsDisconnecting() throws Exception {
int CLIENT_COUNT = 10;
int ITERATIONS = 400;
Random random = new Random();
List<Jedis> clients = new ArrayList<>();
// Build up an initial set of subscribers
for (int i = 0; i < CLIENT_COUNT; i++) {
Jedis client = new Jedis("localhost", ports[0]);
clients.add(client);
CountDownLatch latch = new CountDownLatch(1);
MockSubscriber mockSubscriber = new MockSubscriber(latch);
executor.submit(() -> client.subscribe(mockSubscriber, CHANNEL_NAME));
latch.await();
}
// Start actively publishing in the background
Jedis publishingClient = new Jedis("localhost", ports[0]);
Callable<Void> callable = () -> {
for (int j = 0; j < ITERATIONS; j++) {
publishingClient.publish(CHANNEL_NAME, "hello");
}
return null;
};
Future<Void> future = executor.submit(callable);
// Abnormally close and recreate new subscribers without unsubscribing
for (int i = 0; i < ITERATIONS; i++) {
int candy = random.nextInt(CLIENT_COUNT);
clients.get(candy).close();
Jedis client = new Jedis("localhost", ports[0]);
CountDownLatch latch = new CountDownLatch(1);
MockSubscriber mockSubscriber = new MockSubscriber(latch);
executor.submit(() -> client.subscribe(mockSubscriber, CHANNEL_NAME));
// latch.await(1, TimeUnit.SECONDS);
latch.await();
clients.set(candy, client);
}
// I'm not sure what to call so that this stat gets updated - just wait
a few minutes
// to see stuck threads reported in the log.
// server1.invoke(() ->
//
assertThat(InternalResourceManager.getInternalResourceManager(ClusterStartupRule.getCache()).getStats()
// .getNumThreadStuck()).isEqualTo(0)
// );
future.get();
}
```
----------------------------------------------------------------
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:
[email protected]
> Server thread hangs when client dies
> ------------------------------------
>
> Key: GEODE-8036
> URL: https://issues.apache.org/jira/browse/GEODE-8036
> Project: Geode
> Issue Type: Bug
> Components: redis
> Reporter: Murtuza Boxwala
> Priority: Major
>
> We noticed a case where a server thread was writing to a channel.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)