[ 
https://issues.apache.org/jira/browse/WW-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107171#comment-18107171
 ] 

Lukasz Lenart commented on WW-1742:
-----------------------------------

Triaged 2026-08-23.

_Outcome: documented rather than implemented._ PR: 
https://github.com/apache/struts/pull/1861

_The hook this ticket was waiting on already shipped._ WW-1740 added 
{{getBackgroundProcessName(ActionProxy)}} and WW-1741 made the interceptor 
re-set the session token before returning {{wait}}, so a token-scoped 
background process name is a six-line subclass today. The patch attached here 
is no longer applicable: it overrides {{getName(ActionInvocation)}}, a method 
that has since been renamed.

_Verified against 7.4.0-SNAPSHOT_, with a test added in the PR:
* stock interceptor, two tabs of one session with distinct tokens -> a single 
shared background process, i.e. the limitation reported here is still real;
* the same scenario with {{getBackgroundProcessName}} overridden to append the 
token -> one background process per tab.

_Why the class is not shipped as a framework default._ The session entry is 
reclaimed only when a request observes the background process as done. With the 
action-name key the number of stranded entries is bounded by the number of 
execAndWait actions; with a per-token key every abandoned run strands a 
BackgroundProcess, and the action instance it holds, in the session - 
unbounded. The stock key also fails safe, in that a wait page which loses its 
parameters still joins the running process, whereas a token key fails open and 
starts another background process on every refresh. Donald's 2008 question - 
plugin, or integrated into the existing interceptor - is therefore answered as 
neither: the extension point is the right level for this, and what was missing 
was documentation of it.

The PR adds the recipe and both caveats to the interceptor's "extending" 
javadoc snippet, which is the text rendered on the site, plus a test that pins 
the hook's name so a future rename cannot silently invalidate the documented 
sample the way it invalidated the original patch. No behaviour change.

Thanks to Thomas Micheline for the original report and patch.


> new token associated execute and wait interceptor
> -------------------------------------------------
>
>                 Key: WW-1742
>                 URL: https://issues.apache.org/jira/browse/WW-1742
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>            Reporter: Thomas Micheline
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 7.4.0
>
>         Attachments: TokenizedExecuteAndWaitInterceptor.java
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> A new interceptor could be created which associates background processes with 
> a token rather than a session.  This way, an application could allow separate 
> background processes to the same user operating in multiple windows/tabs.  
> I'll provide the class which makes use of the getName method suggest in 
> WW-1740 (and the change in WW-1741 is also needed if the token interceptor 
> preceeds this interceptor in the stack).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to