Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update modem.js #49

Closed
wants to merge 1 commit into from
Closed

Update modem.js #49

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 19, 2015

you have 2 issues this proposes to fix:

  1. you read the tar synchronously. so you're blocking the event loop.
  2. you create a single consistent buffer for the entire content of the tar, so a tar of 1GB has no chance of passing.

replacing readFileSync with stream solves these issues.

FYI

@apocas
Copy link
Owner

apocas commented Aug 26, 2015

I will test this fix.

Many versions ago reading the contents asynchronously would create havoc on docker side.
There were also some issues regarding the content-length which I can't remember right now.

I will take a look and if everything runs great will merge it :)

@apocas
Copy link
Owner

apocas commented Aug 31, 2015

Have you checked this: apocas/dockerode#128 ?

PS: bigger files should/can use stream interface directly, this doesn't invalidate investigation into the possibility to replace *sync functions.

@apocas
Copy link
Owner

apocas commented Oct 8, 2015

Let's keep these sync calls for now, this way it is possible to use a sync strategy directly or an async strategy using streams as apocas/dockerode#128
keeping everyone happy for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant