Skip to content

Multipart performs blocking call in every instantiation #699

@jonathannaguin

Description

@jonathannaguin

Describe the bug
When a Multipart object is created, the field streamProvider is also instantiated which relies ultimately on FactoryFinder#find (https://github.com/jakartaee/mail-api/blob/master/api/src/main/java/jakarta/mail/util/FactoryFinder.java#L35) that performs blocking operations.

To Reproduce
Create a new MimeMultipart object, for example

new MimeMultipart("mixed");

on a project with https://github.com/reactor/BlockHound installed.

Expected behavior
Either the FactoryFinder needs to be rewritten to not use non-blocking operations or Multipart could use a static reference so only it's blocked at boot up.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions