Multipart form file upload stalls in latest 3.6.0-SNAPSHOT

93 views
Skip to first unread message

Ronald van Raaphorst

unread,
Sep 15, 2018, 6:33:18 AM9/15/18
to vert.x
Hi,

We're uploading files to our vertx 3.6.0-SNAPSHOT based test server (latest build I guess), and all of a sudden uploading a file stalls at about 123 Kb.
At least, that's the size of the file being uploaded in the vertx upload directory. 
For smaller files (< 125 KB) everything works fine. The file is uploaded to the upload directory, and then handed over to my file upload handler.
For larger files (ie > 135 KB) the upload stalls. The file is partially uploaded to the upload directory and my upload handler is never called.

We released a test/acceptence version earlier this week, and that seems to work fine (even with larger files). I'm a bit lost as where to look. 
Could be my own code, but then the plumbing for getting a file to my upload handler is all vertx / body handler work. 
My own upload handler also has not changed, and is never called anyway for lager files.
Is there anything with the body handler that I didn't get? Am I missing something?

I tried to go back to vertx 3.5.3 but we're using the io.vertx.ext.we.multipart.MultipartForm in a lot of tests so that would be some work to refactor or eliminate.

This is the request header / form data for the upload:

    1. Provisional headers are shown
    2. Accept:
      application/json, text/plain, */*
    3. Content-Type:
      multipart/form-data; boundary=----WebKitFormBoundarypvhAg9UMXBHAfQIh
    4. DNT:
      1
    5. Origin:
    6. Referer:
    7. User-Agent:
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
  1. Form Dataview parsed
    1. ------WebKitFormBoundarypvhAg9UMXBHAfQIh
      Content-Disposition: form-data; name="file"; filename="Screen Shot 2017-10-26 at 13.33.10.png"
      Content-Type: image/png


      ------WebKitFormBoundarypvhAg9UMXBHAfQIh
      Content-Disposition: form-data; name="entity"

      user
      ------WebKitFormBoundarypvhAg9UMXBHAfQIh
      Content-Disposition: form-data; name="group"

      pp
      ------WebKitFormBoundarypvhAg9UMXBHAfQIh
      Content-Disposition: form-data; name="refId"

      3
      ------WebKitFormBoundarypvhAg9UMXBHAfQIh--

This is the webserver initialisation relevant part: Somehow I have the feeling that it has something to do with the bodyHandler, since the uploadHandler is never called for larger files.
For smaller files (< 125 KB), everything works just fine.

router = Router.router(vertx) ?: throw Exception("Can not create router")
val mainRouter = router!!

httpServer = vertx.createHttpServer() ?: throw Exception("Can not create httpserver")
val server = httpServer!!

val authProvider = AppAuthenticationProvider(vertx)
val authHandler = AuthenticationHandler(vertx, authProvider);


// Our file upload handler 
val uploadHandler = UploadHandler(
   vertx, authProvider, mapOf( "user" to USER_PROVIDE_FILE_UPLOAD_INFO,)
)

val bodyHandler = BodyHandler.create().setUploadsDirectory(AppPath.upload)
   .setBodyLimit(-1) // unlimited upload? TODO: Reset to 10 * 1024 * 1204 (10M B)

mainRouter.route(HttpMethod.POST, "/file")
   .handler(bodyHandler)
   .handler(uploadHandler)  <-- IS NOT CALLED ANY MORE
Enter code here...

If anyone could shine a light, that would be greatly appreciated. I'll try to setup a small test and try to isolate the problem.

TIA
Ronald




Julien Viet

unread,
Sep 19, 2018, 12:14:17 PM9/19/18
to ve...@googlegroups.com
Hi

can you provide a reproducer project ? that would be very helpful

thanks 

Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/86be5191-7596-4947-b196-bfbc412ba9ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages