aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-12-18 09:19:21 +0200
committerVaadin Code Review <review@vaadin.com>2014-12-18 08:38:08 +0000
commitd80220da2c88591a3a767f9693ec5ceb460724bd (patch)
tree85b937dd51bee78a8d52f2b8e0877ac7a32985ce /server
parent8e4ae3425733bdfdf05c1b9bd5125b35bcb5dce7 (diff)
downloadvaadin-framework-d80220da2c88591a3a767f9693ec5ceb460724bd.tar.gz
vaadin-framework-d80220da2c88591a3a767f9693ec5ceb460724bd.zip
Revert "Workaround for Atmosphere race condition (#13528)" (#14534)
This reverts commit 7f9ea1c9159c8362e6a309b630cbb59a4dae72dd. The problem is fixed in Atmosphere 2.2 Conflicts: server/src/com/vaadin/server/communication/PushRequestHandler.java Change-Id: I04a1b0c87927beb9b2048fee1ec95cd17af53a28
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/communication/PushRequestHandler.java88
1 files changed, 40 insertions, 48 deletions
diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java
index b1a8ea25a7..40eb1b688e 100644
--- a/server/src/com/vaadin/server/communication/PushRequestHandler.java
+++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java
@@ -58,12 +58,6 @@ public class PushRequestHandler implements RequestHandler,
private AtmosphereFramework atmosphere;
private PushHandler pushHandler;
- /**
- * Atmosphere 2.x has a race condition when AtmosphereFramework init(config)
- * is run from two threads at once. See http://dev.vaadin.com/ticket/13528
- */
- private static Object atmosphereInitRaceConditionWorkaroundLock = new Object();
-
public PushRequestHandler(VaadinServletService service)
throws ServiceException {
@@ -93,48 +87,46 @@ public class PushRequestHandler implements RequestHandler,
}
});
- synchronized (atmosphereInitRaceConditionWorkaroundLock) {
- pushHandler = new PushHandler(service);
- atmosphere.addAtmosphereHandler("/*", pushHandler.handler);
- atmosphere.addInitParameter(ApplicationConfig.BROADCASTER_CACHE,
- UUIDBroadcasterCache.class.getName());
- atmosphere.addInitParameter(
- ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true");
- atmosphere.addInitParameter(ApplicationConfig.MESSAGE_DELIMITER,
- String.valueOf(PushConstants.MESSAGE_DELIMITER));
-
- // Disable heartbeat (it does not emit correct events client side)
- // https://github.com/Atmosphere/atmosphere-javascript/issues/141
- atmosphere.addInitParameter(
- ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTORS,
- HeartbeatInterceptor.class.getName());
-
- final String bufferSize = String
- .valueOf(PushConstants.WEBSOCKET_BUFFER_SIZE);
- atmosphere.addInitParameter(
- ApplicationConfig.WEBSOCKET_BUFFER_SIZE, bufferSize);
- atmosphere.addInitParameter(
- ApplicationConfig.WEBSOCKET_MAXTEXTSIZE, bufferSize);
- atmosphere.addInitParameter(
- ApplicationConfig.WEBSOCKET_MAXBINARYSIZE, bufferSize);
- atmosphere.addInitParameter(
- ApplicationConfig.PROPERTY_ALLOW_SESSION_TIMEOUT_REMOVAL,
- "false");
- // Disable Atmosphere's message about commercial support
- atmosphere.addInitParameter(
- "org.atmosphere.cpr.showSupportMessage", "false");
-
- try {
- atmosphere.init(vaadinServletConfig);
-
- // Ensure the client-side knows how to split the message stream
- // into individual messages when using certain transports
- AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();
- trackMessageSize.configure(atmosphere.getAtmosphereConfig());
- atmosphere.interceptor(trackMessageSize);
- } catch (ServletException e) {
- throw new ServiceException("Atmosphere init failed", e);
- }
+ pushHandler = new PushHandler(service);
+ atmosphere.addAtmosphereHandler("/*", pushHandler.handler);
+ atmosphere.addInitParameter(ApplicationConfig.BROADCASTER_CACHE,
+ UUIDBroadcasterCache.class.getName());
+ atmosphere.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT,
+ "true");
+ atmosphere.addInitParameter(ApplicationConfig.MESSAGE_DELIMITER,
+ String.valueOf(PushConstants.MESSAGE_DELIMITER));
+
+ // Disable heartbeat (it does not emit correct events client side)
+ // https://github.com/Atmosphere/atmosphere-javascript/issues/141
+ atmosphere.addInitParameter(
+ ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTORS,
+ HeartbeatInterceptor.class.getName());
+
+ final String bufferSize = String
+ .valueOf(PushConstants.WEBSOCKET_BUFFER_SIZE);
+ atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_BUFFER_SIZE,
+ bufferSize);
+ atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_MAXTEXTSIZE,
+ bufferSize);
+ atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_MAXBINARYSIZE,
+ bufferSize);
+ atmosphere.addInitParameter(
+ ApplicationConfig.PROPERTY_ALLOW_SESSION_TIMEOUT_REMOVAL,
+ "false");
+ // Disable Atmosphere's message about commercial support
+ atmosphere.addInitParameter("org.atmosphere.cpr.showSupportMessage",
+ "false");
+
+ try {
+ atmosphere.init(vaadinServletConfig);
+
+ // Ensure the client-side knows how to split the message stream
+ // into individual messages when using certain transports
+ AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();
+ trackMessageSize.configure(atmosphere.getAtmosphereConfig());
+ atmosphere.interceptor(trackMessageSize);
+ } catch (ServletException e) {
+ throw new ServiceException("Atmosphere init failed", e);
}
}