You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by "Andy Kurth (JIRA)" <ji...@apache.org> on 2014/03/24 17:58:46 UTC

[jira] [Updated] (VCL-755) Add 'if defined' checks for all get_management_node_info calls

     [ https://issues.apache.org/jira/browse/VCL-755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Kurth updated VCL-755:
---------------------------

    Description: 
There are calls to get_management_node_info in utils.pm, DataStructure.pm, and healthcheck.pm which do not check if a defined value is returned such as:
$identity_paths = get_management_node_info()->{keys};

There are cases where get_management_node_info will fail and return null such as if a database connection cannot be obtained.  When this happens and the caller doesn't check for a defined value, the following unhandled error is generated:

{quote}
Can't use an undefined value as a HASH reference at /usr/local/vcl/bin/../lib/VCL/utils.pm line 4017.
{quote}

Every line containing "get_management_node_info()->" should be changed to first retrieve the info, then check it, then access the hash reference value.

  was:
There are calls to get_management_node_info in utils.pm, DataStructure.pm, and healthcheck.pm which do not check if a defined value is returned such as:
$identity_paths = get_management_node_info()->{keys};

There are cases where get_management_node_info will fail and return null such as if a database connection cannot be obtained.  When this happens and the caller doesn't check for a defined value, the following unhandled error is generated:

Can't use an undefined value as a HASH reference at /usr/local/vcl/bin/../lib/VCL/utils.pm line 4017.

Every line containing "get_management_node_info()->" should be changed to first retrieve the info, then check it, then access the hash reference value.


> Add 'if defined' checks for all get_management_node_info calls
> --------------------------------------------------------------
>
>                 Key: VCL-755
>                 URL: https://issues.apache.org/jira/browse/VCL-755
>             Project: VCL
>          Issue Type: Bug
>          Components: vcld (backend)
>    Affects Versions: 2.3.2
>            Reporter: Andy Kurth
>             Fix For: 2.4
>
>
> There are calls to get_management_node_info in utils.pm, DataStructure.pm, and healthcheck.pm which do not check if a defined value is returned such as:
> $identity_paths = get_management_node_info()->{keys};
> There are cases where get_management_node_info will fail and return null such as if a database connection cannot be obtained.  When this happens and the caller doesn't check for a defined value, the following unhandled error is generated:
> {quote}
> Can't use an undefined value as a HASH reference at /usr/local/vcl/bin/../lib/VCL/utils.pm line 4017.
> {quote}
> Every line containing "get_management_node_info()->" should be changed to first retrieve the info, then check it, then access the hash reference value.



--
This message was sent by Atlassian JIRA
(v6.2#6252)