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

Bugfix/kill copy on disconnect #932

Merged
merged 4 commits into from
Jul 30, 2014
Merged

Conversation

kuenishi
Copy link
Contributor

Copying can't be stopped on client disconnect, because it does not need any socket read/writes once copying started. That makes detecting client disconnect harder - this patch puts a zero-timeout read on socket to find {error, closed} and other errors. This is a dirty hack and mochiweb or webmachine should have such interface that handles lower layer connection error handling, but for now we adopt this hack, which should be fixed in the future.
Copy should be cancelled because orphan copy without clients are likely not required by clients and may cause overloaded cluster.

Important limitation is: if client sends any additional HTTP request to CS during copy being processed, Riak CS reads that request and throws error, and cancels the copy.

@kuenishi kuenishi added the Bug label Jul 30, 2014
@kuenishi kuenishi added this to the 1.5.0 milestone Jul 30, 2014
-> {ok, lfs_manifest()} | {error, term()}.
get_and_put(GetPid, PutPid, MD5, ContFun) ->
case ContFun() of
true ->
Copy link
Contributor

Choose a reason for hiding this comment

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

A trailing white space here.

@kuenishi
Copy link
Contributor Author

Add note: detection only with inet:peername/1 didn't work for me, with this server , with my linux. That is why using gen_tcp:recv/2 for disconnect detection. Maybe peername is cached inside the socket?

@kuenishi
Copy link
Contributor Author

Fixed :)

borshop added a commit that referenced this pull request Jul 30, 2014
Bugfix/kill copy on disconnect

Reviewed-by: shino
@shino
Copy link
Contributor

shino commented Jul 30, 2014

@borshop merge

@borshop borshop merged commit 20eb337 into release/1.5 Jul 30, 2014
@shino shino deleted the bugfix/kill-copy-on-disconnect branch July 30, 2014 08:36
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