mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8656: reporting ignored exceptions in server
This commit is contained in:
parent
a0ba7d310e
commit
6fa8b7578e
|
|
@ -16,6 +16,8 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import static com.cloud.utils.AutoCloseableUtil.closeAutoCloseable;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
|
@ -81,12 +83,7 @@ public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAll
|
|||
} catch (IOException e) {
|
||||
return new IpAddr();
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
closeAutoCloseable(in, "closing buffered reader");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -121,12 +118,7 @@ public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAll
|
|||
} catch (IOException e) {
|
||||
return false;
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
closeAutoCloseable(in, "buffered reader close");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -693,6 +693,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||
if (backupState.equals(FirewallRule.State.Active))
|
||||
applyLoadBalancerConfig(cmd.getLbRuleId());
|
||||
} catch (ResourceUnavailableException e1) {
|
||||
s_logger.info("[ignored] applying load balancer config.", e1);
|
||||
} finally {
|
||||
loadBalancer.setState(backupState);
|
||||
_lbDao.persist(loadBalancer);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import javax.crypto.SecretKey;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.utils.nio.Link;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -118,6 +117,7 @@ import com.cloud.utils.db.TransactionLegacy;
|
|||
import com.cloud.utils.db.TransactionStatus;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
import com.cloud.utils.nio.Link;
|
||||
import com.cloud.utils.script.Script;
|
||||
|
||||
public class ConfigurationServerImpl extends ManagerBase implements ConfigurationServer {
|
||||
|
|
@ -757,6 +757,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
|||
try (DataInputStream dis = new DataInputStream(new FileInputStream(privkeyfile))) {
|
||||
dis.readFully(arr1);
|
||||
} catch (EOFException e) {
|
||||
s_logger.info("[ignored] eof reached");
|
||||
} catch (Exception e) {
|
||||
s_logger.error("Cannot read the private key file", e);
|
||||
throw new CloudRuntimeException("Cannot read the private key file");
|
||||
|
|
@ -766,6 +767,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
|||
try (DataInputStream dis = new DataInputStream(new FileInputStream(pubkeyfile))) {
|
||||
dis.readFully(arr2);
|
||||
} catch (EOFException e) {
|
||||
s_logger.info("[ignored] eof reached");
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Cannot read the public key file", e);
|
||||
throw new CloudRuntimeException("Cannot read the public key file");
|
||||
|
|
@ -902,7 +904,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
|||
} else {
|
||||
command = new Script("/bin/bash", s_logger);
|
||||
}
|
||||
if (this.isOnWindows()) {
|
||||
if (isOnWindows()) {
|
||||
scriptPath = scriptPath.replaceAll("\\\\" ,"/" );
|
||||
systemVmIsoPath = systemVmIsoPath.replaceAll("\\\\" ,"/" );
|
||||
publicKeyPath = publicKeyPath.replaceAll("\\\\" ,"/" );
|
||||
|
|
|
|||
|
|
@ -228,12 +228,14 @@ public class ConsoleProxyServlet extends HttpServlet {
|
|||
try {
|
||||
w = Integer.parseInt(value);
|
||||
} catch (NumberFormatException e) {
|
||||
s_logger.info("[ignored] not a number: " + value);
|
||||
}
|
||||
|
||||
value = req.getParameter("h");
|
||||
try {
|
||||
h = Integer.parseInt(value);
|
||||
} catch (NumberFormatException e) {
|
||||
s_logger.info("[ignored] not a number: " + value);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue