Skip to content

Lazily create Throwables #5040

@imperatorx

Description

@imperatorx

Summary

Running a hello world benchmark with an anonymous authentication set up (so an authentication is present, and the authentication has access to the controller method) still causes Spring security to fill useless stack traces in ReactiveAuthorizationManager.java

Actual Behavior

The following part is called at the Mono pipeline construction time, so a stack trace gets created.

	.switchIfEmpty( Mono.error(new AccessDeniedException("Access Denied")) )

Expected Behavior

The part should be deferred, this way the stack trace gets only created in case the pipeline is indeed empty (no authentication from upstream source flowing down)

	.switchIfEmpty( Mono.defer(() -> Mono.error(new AccessDeniedException("Access Denied"))) )

Configuration

Strandard Spring Boot RC2 with a web filter to create an anonymous authentication token

Version

5.0.2.RELEASE

Sample

spring

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions