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

Fixes shell buffer overflow for large input specs #16

Merged
merged 1 commit into from
Jul 5, 2019

Conversation

gervasiocaj
Copy link
Contributor

@gervasiocaj gervasiocaj commented May 24, 2019

The exec() function buffers the output of the command executed.
When using a large input spec (over 20k lines), the process is terminated due to overflowing the buffer.

Increasing the buffer also fixes the issue, but for a generic solution, spawn() pipes the output directly without buffering, and behaves just the same with the option shell: true.

To replicate the error, run exec(command, { maxBuffer: 1000 }) on the petstore example.

More info on https://medium.freecodecamp.org/node-js-child-processes-everything-you-need-to-know-e69498fe970a.

The `exec()` function buffers the output of the command executed.
When using a large input spec (over 20k lines), the process is
terminated due to overflowing the buffer.
Increasing the buffer also fixes the issue, but for a generic solution,
`spawn()` pipes the output directly without buffering, and behaves just
the same with the option `shell: true`.
@wing328
Copy link
Member

wing328 commented Jun 2, 2019

@gervasiocaj thanks for the PR. I'll review and let you know if I've any question.

@kay-schecker kay-schecker merged commit a16383a into OpenAPITools:master Jul 5, 2019
@gervasiocaj gervasiocaj deleted the patch-1 branch July 5, 2019 13:30
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.

3 participants