Skip to content

File Upload with large files blocks and stops processing #1012

Open
@johnjaylward

Description

@johnjaylward

I have an integration test that looks like this:

final Reference resourceUri = new Reference("http://localhost/customer").addSegment("123")
                .addSegment("location").addSegment("456").addSegment("media");
resourceUri.setBaseRef("http://localhost");
final Request request = new Request(Method.POST, resourceUri);

final FormDataSet fds = new FormDataSet();
fds.setMultipart(true);
if (tags != null) {
    final FormData tagRep = new FormData("tags", new JsonRepresentation(tags));
    fds.getEntries().add(tagRep);
}
if (file != null) {
    final FormData fileRep = new FormData("file", new FileRepresentation(file, mediaType));
    fds.getEntries().add(fileRep);
}

request.setEntity(fds);
final Response resp = this.router.handle(request);
... 
... verify response
... 

This works fine for small files, but for one test file I have over 2GB, Restlet appears to lock up in the FileUploadBase.parseRequest method at line 347 : Streams.copy(item.openStream(), fileItem.getOutputStream(), true);

If it's not locking up, it's being extremely slow. Copying the file from one folder to another takes about 2 minutes, however, this doesn't appear to do anything for at least 5 minutes.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions