[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15924483#comment-15924483
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8855:
--------------------------------------------

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

    https://github.com/apache/cloudstack/pull/837#discussion_r105952120
  
    --- Diff: server/src/com/cloud/alert/AlertManagerImpl.java ---
    @@ -767,7 +767,9 @@ public void sendAlert(AlertType alertType, long 
dataCenterId, Long podId, Long c
                     // set up a new alert
                     AlertVO newAlert = new AlertVO();
                     newAlert.setType(alertType.getType());
    -                newAlert.setSubject(subject);
    +                //do not have a seperate column for content.
    +                //appending the message to the subject for now.
    +                newAlert.setSubject(subject+content);
    --- End diff --
    
    I understand that 999 characters may seem a lot, but the `content` may 
contain some long strings. for instance, in 
`com.cloud.network.router.VirtualNetworkApplianceManagerImpl.RvRStatusUpdateTask.checkDuplicateMaster(List<DomainRouterVO>)`,
 it is generated a `subject` and a `content` that together (depending on 
variable combinations used to create those strings) can go over 500 chars.
    
    What concerns me the most are methods such as 
`org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createVolumeAsyncCallback(AsyncCallbackDispatcher<?
 extends BaseImageStoreDriverImpl, DownloadAnswer>, 
CreateContext<CreateCmdResult>)`, where the `subject` and `content` would be 
the same, and they are created using an error message that may come from the 
most different places.
    
    The use of `com.cloud.alert.AlertManagerImpl.sendAlert(AlertType, long, 
Long, String, String)` is quite broad and it would be a lot of work to check 
every single place it is used. For me, the code that you are adding at line 772 
seem like a half-measure that is bug prone. I would like to hear the feedback 
from others on this topic.


> Improve Error Message for Host Alert State
> ------------------------------------------
>
>                 Key: CLOUDSTACK-8855
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8855
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.6.0
>            Reporter: Bharat Kumar
>            Assignee: Bharat Kumar
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to