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

[SCB-484] Servlet rest support download #750

Merged
merged 5 commits into from
Jun 8, 2018

Conversation

wujimin
Copy link
Contributor

@wujimin wujimin commented Jun 5, 2018

did not provide download integration test, but already test locally
because upload did not support for servlet yet,
but it's not good to delete upload test case.

@wujimin wujimin force-pushed the servlet-rest-support-download branch from bbabccb to 3a7e22b Compare June 5, 2018 06:20
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 87.411% when pulling 3a7e22b on wujimin:servlet-rest-support-download into 517a9ff on apache:master.

action.run();
}
} catch (IOException e) {
currentBufferCount--;
Copy link
Member

Choose a reason for hiding this comment

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

Here is no sychronized. If we just need to make sure currentBufferCount is automatic, we don't need to use the synchroized to do this job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not just protect currentBufferCount, we must protect close/drain logic.

/**
* for pump from a readStream
*/
public class OutputStreamToWriteStream implements WriteStream<Buffer>, AsyncCloseable<Void> {
Copy link
Member

Choose a reason for hiding this comment

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

Too much synchronized in this class, if we can make sure there is only one thread handle this write stream, that could make our life much easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if readStream and writeStream both are vertx eventloop stream, then it's only one thread
but if one of readStream and writeStream is wrapped from a blocked stream(inputStream/outputStream), then it's multiple thread
so we must use synchronized logic just like vertx asyncFile do.

@wujimin wujimin merged commit 7db0781 into apache:master Jun 8, 2018
@wujimin wujimin deleted the servlet-rest-support-download branch July 11, 2018 00:48
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

4 participants