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

LSC process hangs indefinitely when ouput overflow the available buffer #10

Closed
soisik opened this issue Mar 5, 2019 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@soisik
Copy link
Contributor

soisik commented Mar 5, 2019

During the clean phase, if the LIST script returns many entries, LSC will stop reading and hangs indefinitely.

Cause is explained in this SOF answer : https://stackoverflow.com/a/5483880:

the process is blocked as soon as the buffer is full and waits for your process to continue reading. Your process in turn waits for the other process to finish (which it won't because it waits for your process, ...). This is a classical deadlock situation. You need to continually read from the processes input stream to ensure that it doesn't block.

The problem is located in AbstractExecutableLdifService.execute(String[] runtime, String[] env, String input, StringBuffer datas) method: p.waitFor(); is called before p.getInputStream() is invoked, and inputstream is not read using BufferedReader.

Many thanks to Lior Dotan who has first reported this issue on LSC ML https://www.mail-archive.com/[email protected]/msg03763.html.

PR is following.

soisik added a commit to Worteks/lsc-executable-plugin that referenced this issue Mar 5, 2019
soisik added a commit to Worteks/lsc-executable-plugin that referenced this issue Mar 5, 2019
soisik added a commit that referenced this issue Mar 6, 2019
…-read

Fixed issue #10 : LSC process hangs indefinitely when ouput overflow the available buffer
@soisik soisik self-assigned this Mar 6, 2019
@soisik soisik added the bug label Mar 6, 2019
@soisik soisik added this to the 1.1 milestone Mar 6, 2019
@coudot coudot closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants