Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/792#discussion_r39839158
  
    --- Diff: 
plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
 ---
    @@ -3407,6 +3390,18 @@ public void handleSrAndVdiDetach(final String iqn, 
final Connection conn) throws
             removeSR(conn, sr);
         }
     
    +    protected void destroyUnattachedVBD(Connection conn, VM vm) {
    +        try {
    +            for (VBD vbd : vm.getVBDs(conn)) {
    +                if (Types.VbdType.DISK.equals(vbd.getType(conn)) && 
!vbd.getCurrentlyAttached(conn)) {
    +                    vbd.destroy(conn);
    +                }
    +            }
    +        } catch (final Exception e) {
    +            s_logger.debug("destroyUnattachedVBD failed due to " + 
e.toString());
    --- End diff --
    
    @koushik-das I would catch only specific exceptions and give them specific 
messages and report on results in a finally block. the present state is that 
any numberformat, memory, stackoverflow or devidebyzero will be caught here, 
where it is not relevant. My initial remark was to make sure we know what kind 
of exception is caught at least. This is not always clear from the message 
which may be null.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to