This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 129eaea Fix intermittently failing test.
129eaea is described below
commit 129eaea0e9fae242689d52c365d3e3378afc3fbb
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 10 21:29:50 2020 +0100
Fix intermittently failing test.
If you fake a blocking with async write while processing a read there is
a strong chance of a deadlock. The read will be holding a lock on the
SocketWrapper. If the async write does not complete in-line it will
perform a dispatch when it is ready to write and that dispatch will try
to obtain a lock on the socket wrapper. The lock on that opbject is
already held and a deadlock will follow.
---
test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
index 21379e0..88ab292 100644
--- a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
+++ b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
@@ -403,7 +403,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
@OnMessage
public String onMessage(String message, Session session) throws
Exception {
received.add(message);
- session.getAsyncRemote().sendText(MESSAGE_ONE).get();
+ session.getBasicRemote().sendText(MESSAGE_ONE);
return message;
}
@@ -425,9 +425,9 @@ public class TestEncodingDecoding extends TomcatBaseTest {
@OnMessage
public String onMessage(String message, Session session) throws
IOException {
received.add(message);
- session.getAsyncRemote().setBatchingAllowed(true);
- session.getAsyncRemote().sendText(MESSAGE_ONE);
- session.getAsyncRemote().setBatchingAllowed(false);
+ session.getBasicRemote().setBatchingAllowed(true);
+ session.getBasicRemote().sendText(MESSAGE_ONE);
+ session.getBasicRemote().setBatchingAllowed(false);
return MESSAGE_TWO;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]