mirror of https://github.com/apache/cloudstack.git
handling tcp close event in netty server
while the file is in uploading state and connection is reset by peer, volume upload request posted again shows the upload is IN_Progress state. marking them as errored
This commit is contained in:
parent
7d1ca8a55c
commit
6b8b4b92e6
|
|
@ -94,6 +94,13 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
String message = "file receive failed or connection closed prematurely.";
|
||||
logger.error(message);
|
||||
storageResource.updateStateMapWithError(uuid, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
|
||||
if (msg instanceof HttpRequest) {
|
||||
|
|
|
|||
|
|
@ -2774,7 +2774,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||
return _ssvmPSK;
|
||||
}
|
||||
|
||||
private void updateStateMapWithError(String uuid,String errorMessage) {
|
||||
public void updateStateMapWithError(String uuid,String errorMessage) {
|
||||
UploadEntity uploadEntity=null;
|
||||
if (uploadEntityStateMap.get(uuid)!=null) {
|
||||
uploadEntity=uploadEntityStateMap.get(uuid);
|
||||
|
|
|
|||
Loading…
Reference in New Issue