[MAGNOLIA-7704] Asynchronous context implementation Created: 10/Jan/20  Updated: 09/Mar/21  Resolved: 28/Jan/20

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2

Type: Improvement Priority: Neutral
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 5h 13m
Original Estimate: 1h

Issue Links:
causality
is causing MGNLCT-138 Exception when initializing content-type Closed
dependency
is depended upon by MGNLUI-5543 Implement 'asynchronous' property for... Closed
supersession
supersedes MGNLUI-3532 LocalTaskDispatcher fires event alway... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Sprint: UI Framework 14, UI Framework & 6.2 Ramp up 15
Story Points: 8

 Description   

It becomes more common to use Magnolia context asynchronously (Periscope search, asynchronous actions in UI).

I'd be nice to have a dedicated context to not duplicate similar code in different projects.



 Comments   
Comment by Roman Kovařík [ 17/Jan/20 ]

Reopened: implement support for web context.

Comment by Federico Grilli [ 21/Jan/20 ]

Unfortunately the problem seems to persist in the latest CE snapshot

  • Create and publish a file in resources app
  • Get error
    2020-01-21 19:39:19,051 ERROR nfo.magnolia.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
    java.lang.IllegalStateException: MgnlContext is already set for this thread. Please run result of info.magnolia.context.AsynchronousContext.OperationFactory#wrap in a separate thread
    	at info.magnolia.context.AsynchronousContext$OperationFactory.lambda$wrap$0(AsynchronousContext.java:182) ~[magnolia-core-6.2-SNAPSHOT.jar:?]
    	at info.magnolia.context.AsynchronousContext$OperationFactory.lambda$wrap$2(AsynchronousContext.java:200) ~[magnolia-core-6.2-SNAPSHOT.jar:?]
    	at com.machinezoo.noexception.CheckedExceptionHandler$CheckedRunnable.run(CheckedExceptionHandler.java:97) ~[noexception-1.3.4.jar:?]
    	at info.magnolia.admincentral.ResurfaceUI.lambda$accessSynchronously$0(ResurfaceUI.java:113) ~[magnolia-admincentral-6.2-SNAPSHOT.jar:?]
    	at com.vaadin.ui.UI.accessSynchronously(UI.java:1519) ~[vaadin-server-8.8.5.jar:8.8.5]
    	at info.magnolia.admincentral.ResurfaceUI.accessSynchronously(ResurfaceUI.java:104) ~[magnolia-admincentral-6.2-SNAPSHOT.jar:?]
    
    
Comment by Roman Kovařík [ 04/Feb/20 ]

Closed:
Magnolia now offers context implementation which is create from request context but can live after the request is finished.
This is now used out of the box when using UI#access.

Generated at Mon Feb 12 04:26:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.