Skip to content

Conversation

@pieterjandesmedt
Copy link

exec() maxBuffer override option now in a separate branch.

@nfischer
Copy link
Member

Marking this as an update of #270 (which was closed).

@nfischer
Copy link
Member

Does this also work for execSync?

@pieterjandesmedt
Copy link
Author

Good catch - option added to execSync as well.

@nfischer
Copy link
Member

Do we also need to make the change on lines like https://github.com/pieterjandesmedt/shelljs/blob/exec-maxBuffer-override/src/exec.js#L90 where the value is hardcoded?

Also, could you move 20*1024*1024 into a constant at the top of the file? Something like DEFAULT_BUF_SIZE.

@pieterjandesmedt
Copy link
Author

Done & done.

@nfischer
Copy link
Member

Let me check this later today, and I'll give you an LGTM if I don't find any issues.

do you know of any way that we could continue using small buffers but simply open up a new buffer when it gets full? This would be even better, since then we could have an option to effectively never crash from filling up the buffer

@pieterjandesmedt
Copy link
Author

AFAIK, there's no easy way to increase the buffer size once the child process is running...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to combine these checks into one if? That way we only have to assign the default value once, which is probably cleaner.

@nfischer
Copy link
Member

Overall, this looks great! Just a few comments above to address. I tested this on Linux, and saw that this helped avoid crashes when the output buffer was exceeded, so it works as intended.

Also, please squash your commits and rebase off the upstream master, and this should be good to merge.

@ariporad
Copy link
Contributor

@pieterjandesmedt: Could you add the changes and rebase onto master please? I'd really like to get this into the next release.

@ariporad ariporad added this to the v0.6.0 milestone Jan 24, 2016
@ariporad
Copy link
Contributor

ariporad commented Feb 3, 2016

@pieterjandesmedt: bump

@ariporad ariporad modified the milestones: v0.7.0, v0.6.0 Feb 3, 2016
add maxBuffer override to execSync as well

added constant DEFAULT_MAXBUFFER_SIZE and made sure maxBuffer is an integer

fixed indentation and removed delimiter in example

add ability to override execAsync's maxBuffer default of 20MiB
@pieterjandesmedt
Copy link
Author

Unsure how to proceed... I squashed the commits an created PR #333. You decide :-)

@ariporad
Copy link
Contributor

ariporad commented Feb 4, 2016

@pieterjandesmedt: As much as I hate to reject a PR, it looks like this has been fixed by #335, so I have to close this. Sorry.

@ariporad ariporad closed this Feb 4, 2016
@pieterjandesmedt
Copy link
Author

No problem, as long as it's fixed, I'm happy :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants