You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StandardServletMultipartResolver.resolveMultipart invoked multiple times for same request #13841
The following should be analyzed because off hand it seems inefficient. Multipart requests are resolved multiple times for handling url mappings which appears to be real inefficient.
DefaultUrlMappingInfo.getActionName() called checkDispatchAction(), which called tryMultipartParams() and then MultipartResolver.resolveMultipart() while URL mappings were matched, in addition to the dispatcher''s own checkMultipart. That call was removed in 611061e (#15565, 2026-04-08). That commit is in v8.0.0-M1, v8.0.0-M2, v8.0.0-M3, v8.0.0-M4, v8.0.0-M5, v8.0.0-M6, v8.0.0-RC1, and v8.0.0-RC2. The unused tryMultipartParams method, which contained resolver.resolveMultipart(request), was deleted in 32b0d9f (#16149, 2026-08-14). That commit is in v8.0.0-RC1 and v8.0.0-RC2. Both commits are on current origin/8.0.x (d13aa33282).
On that HEAD, getActionName() only evaluates the action name (DefaultUrlMappingInfo.java lines 193-196). GrailsDispatcherServlet.checkMultipart (GrailsDispatcherServlet.groovy lines 90-118) delegates to Spring once per dispatch and skips error, forward, and include requests. WebUtils.resolveMultipartRequest only finds a request that was already resolved. GrailsDispatcherServletSpec expects multipartResolver.resolveMultipart exactly once for a multipart request and zero times otherwise.
The old path is still on 7.2.x (DefaultUrlMappingInfo.java lines 206, 241, and 278).
Activity
jamesfredley commentedon Oct 2, 2026
This is fixed on 8.0.x.
DefaultUrlMappingInfo.getActionName()calledcheckDispatchAction(), which calledtryMultipartParams()and thenMultipartResolver.resolveMultipart()while URL mappings were matched, in addition to the dispatcher''s owncheckMultipart. That call was removed in 611061e (#15565, 2026-04-08). That commit is in v8.0.0-M1, v8.0.0-M2, v8.0.0-M3, v8.0.0-M4, v8.0.0-M5, v8.0.0-M6, v8.0.0-RC1, and v8.0.0-RC2. The unusedtryMultipartParamsmethod, which containedresolver.resolveMultipart(request), was deleted in 32b0d9f (#16149, 2026-08-14). That commit is in v8.0.0-RC1 and v8.0.0-RC2. Both commits are on currentorigin/8.0.x(d13aa33282).On that HEAD,
getActionName()only evaluates the action name (DefaultUrlMappingInfo.javalines 193-196).GrailsDispatcherServlet.checkMultipart(GrailsDispatcherServlet.groovylines 90-118) delegates to Spring once per dispatch and skips error, forward, and include requests.WebUtils.resolveMultipartRequestonly finds a request that was already resolved.GrailsDispatcherServletSpecexpectsmultipartResolver.resolveMultipartexactly once for a multipart request and zero times otherwise.The old path is still on
7.2.x(DefaultUrlMappingInfo.javalines 206, 241, and 278).