quattor / ncm-cdispd

Node Configuration Manager Configuration Dispatch Daemon
www.quattor.org
Other
3 stars 6 forks source link

ncm-cdispd does not refresh $last_ncd_status during main_loop #55

Open ned21 opened 3 years ago

ned21 commented 3 years ago

I noticed that ncm-cdispd was running all dispatched components every time a new profile was received, and not just the changed sub-trees. I think there's a bug here:

    my $last_ncd_status = init_components();
    ...
    while (1) {
        main_loop($cm, $last_ncd_status, $ref_cid);
    }

Since this is a local not global variable, the $last_ncd_status is set when ncm-dispd starts up and is never changed. The fix is to make it a global variable that can be modified within the main_loop sub.