aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-08-19 17:31:46 +0300
committerArtur Signell <artur@vaadin.com>2013-08-19 17:31:46 +0300
commit633e0201cd2a79893d043c77b15062342cfe46e0 (patch)
tree19fafa44c16a391e182413609b8ba7cb1f568eab /server
parent7ca0ced36217a0783b25c59b58ba31fd5dae1e28 (diff)
parent8ba41172216a98a45f82319d9a98d04a26efa52a (diff)
downloadvaadin-framework-633e0201cd2a79893d043c77b15062342cfe46e0.tar.gz
vaadin-framework-633e0201cd2a79893d043c77b15062342cfe46e0.zip
Merge changes from origin/7.1
16d17f9 Fix native scrolling regression in iOS 6 homescreen apps (#12295) 7212e02 Fix race in VaadinService.lockSession() (#12282) 2d5a107 Update "lastRequestedFirstvisible" field value right away (#10666). 325cdf9 Disable failing calendar Actions Menu Test (#12181) 8ba4117 Split UiAccess test (#12332) Change-Id: I30e7aaacaf0ecbdc1a6dbdf956a6e48f4846de32
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/VaadinService.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java
index bd4637c407..cf6c806ead 100644
--- a/server/src/com/vaadin/server/VaadinService.java
+++ b/server/src/com/vaadin/server/VaadinService.java
@@ -570,6 +570,9 @@ public abstract class VaadinService implements Serializable {
*
* @param wrappedSession
* The session to lock
+ *
+ * @throws IllegalStateException
+ * if the session is invalidated before it can be locked
*/
protected void lockSession(WrappedSession wrappedSession) {
Lock lock = getSessionLock(wrappedSession);
@@ -590,6 +593,17 @@ public abstract class VaadinService implements Serializable {
}
}
lock.lock();
+
+ try {
+ // Someone might have invalidated the session between fetching the
+ // lock and acquiring it. Guard for this by calling a method that's
+ // specified to throw IllegalStateException if invalidated
+ // (#12282)
+ wrappedSession.getAttribute(getLockAttributeName());
+ } catch (IllegalStateException e) {
+ lock.unlock();
+ throw e;
+ }
}
/**
@@ -613,7 +627,12 @@ public abstract class VaadinService implements Serializable {
WrappedSession wrappedSession = getWrappedSession(request,
requestCanCreateSession);
- lockSession(wrappedSession);
+ try {
+ lockSession(wrappedSession);
+ } catch (IllegalStateException e) {
+ throw new SessionExpiredException();
+ }
+
try {
return doFindOrCreateVaadinSession(request, requestCanCreateSession);
} finally {