From 3766ab61c90885c8657186c4b033667dc2fa25db Mon Sep 17 00:00:00 2001 From: Artur Date: Tue, 1 Aug 2017 10:56:41 +0300 Subject: Do full connector tracker cleanup when the session lock is released (#9707) (#9730) As there is no "request end" call after invoking UI.access() from a background thread, the connector map was not earlier properly cleaned afterwards. If you toggled visibility of a component from the background thread, the tracker state became inconsistent. If this becomes a performance problem, it could probably be optimized to that cleanup is done in request end and only at the end of access if not inside a request. Backported from master Fixes #9693 --- server/src/main/java/com/vaadin/server/VaadinService.java | 14 -------------- server/src/main/java/com/vaadin/server/VaadinSession.java | 5 +++++ server/src/main/java/com/vaadin/ui/ConnectorTracker.java | 14 ++++---------- 3 files changed, 9 insertions(+), 24 deletions(-) (limited to 'server') diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java index 75124aa6ef..e453332f02 100644 --- a/server/src/main/java/com/vaadin/server/VaadinService.java +++ b/server/src/main/java/com/vaadin/server/VaadinService.java @@ -1365,20 +1365,6 @@ public abstract class VaadinService implements Serializable { final long duration = (System.nanoTime() - (Long) request .getAttribute(REQUEST_START_TIME_ATTRIBUTE)) / 1000000; session.setLastRequestDuration(duration); - - // Check that connector tracker is in a consistent state here to - // avoid doing it multiple times for a single request - for (UI ui : session.getUIs()) { - try { - ui.getConnectorTracker().ensureCleanedAndConsistent(); - } catch (AssertionError e) { - getLogger().log(Level.SEVERE, - "Error cleaning ConnectionTracker", e); - } catch (Exception e) { - getLogger().log(Level.SEVERE, - "Error cleaning ConnectionTracker", e); - } - } } finally { session.unlock(); } diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java index f4ebc06335..7014a5f1f5 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -1009,6 +1009,11 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { "Exception while cleaning connector map for ui " + ui.getUIId(), e); + } catch (AssertionError e) { + getLogger().log(Level.SEVERE, + "Exception while cleaning connector map for ui " + + ui.getUIId(), + e); } } } diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index 043c1174fb..d2b9b65764 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -272,17 +272,7 @@ public class ConnectorTracker implements Serializable { } cleanStreamVariables(); - } - /** - * Performs expensive checks to ensure that the connector tracker is cleaned - * properly and in a consistent state. - *

- * This should only be called by the framework. - * - * @since - */ - public void ensureCleanedAndConsistent() { // Do this expensive check only with assertions enabled assert isHierarchyComplete() : "The connector hierarchy is corrupted. " + "Check for missing calls to super.setParent(), super.attach() and super.detach() " @@ -315,6 +305,10 @@ public class ConnectorTracker implements Serializable { } else if (!uninitializedConnectors.contains(connector) && !LegacyCommunicationManager .isConnectorVisibleToClient(connector)) { + // Connector was visible to the client but is no longer (e.g. + // setVisible(false) has been called or SelectiveRenderer tells + // it's no longer shown) -> make sure that the full state is + // sent again when/if made visible uninitializedConnectors.add(connector); diffStates.remove(connector); assert isRemovalSentToClient(connector) : "Connector " -- cgit v1.2.3 h Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats

path: root/apps/testing/lib/AlternativeHomeUserBackend.php
blob: 1e86b0bc55575013050eb7d3a99b9fefb838b5e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56