mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 01:32:18 +02:00
Handle IllegalReferenceCountException for decoder, while uploading ISO from local (#10879)
This commit is contained in:
parent
714b04e3a5
commit
9c6dfd2b26
@ -27,6 +27,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import io.netty.util.IllegalReferenceCountException;
|
||||
import org.apache.cloudstack.storage.template.UploadEntity;
|
||||
import org.apache.cloudstack.utils.imagestore.ImageStoreUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -229,8 +230,15 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
|
||||
private void reset() {
|
||||
request = null;
|
||||
// destroy the decoder to release all resources
|
||||
decoder.destroy();
|
||||
decoder = null;
|
||||
if (decoder != null) {
|
||||
try {
|
||||
decoder.destroy();
|
||||
} catch (IllegalReferenceCountException e) {
|
||||
logger.warn("Decoder already destroyed", e);
|
||||
}
|
||||
|
||||
decoder = null;
|
||||
}
|
||||
}
|
||||
|
||||
private HttpResponseStatus readFileUploadData() throws IOException {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user