Hi,
I’ve a particular YANG file-
odu.yang:
container odu {
presence "Attributes related to ODU interface.";
leaf rate {
type string;
}
container opu {
leaf payload {
type string {
length 2;
}
default "NA";
}
}
}
To this YANG file, I’ve an annotation file, that adds hook call-points to ‘odu’ and ‘payload’. Also, both are registered under same call-point.
odu-ann.yang:
tailf:annotate /odu {
tailf:callpoint DefaultHook {
tailf:set-hook node;
}
}
tailf:annotate "odu/opu/payload" {
tailf:callpoint DefaultHook {
tailf:set-hook subtree;
}
}
Further, ‘payload’ has a default value. Also when a user creates ‘odu’ container, providing only ‘rate’ value but not ‘opu/payload’ value, then hook has to set ‘payload’ based on ‘rate’ value.
As per this, within hook implementation, during create() call for ‘odu’, I check rate and set a value for ‘payload’. I expected that this will trigger set_elem() from same call-point for ‘payload’. However, I see that maapi_set_elem2() function used to set payload value hangs and does not return. After a while, worker socket gets closed due to timeout.
LOGS:
<ERR> 23-Feb-2020::22:04:28.653 endor confd[32334]: devel-c Worker socket query timed out daemon my_hook id 7
<ERR> 23-Feb-2020::22:04:28.657 endor confd[32334]: devel-c set_elem error {external_timeout, ""} for callpoint DefaultHook path /odu/opu/payload-type
<ERR> 23-Feb-2020::22:04:28.657 endor confd[32334]: devel-c create error {external_timeout, ""} for callpoint DefaultHook path /odu
I’ve a multi-threaded hook implementation. It has a main thread, a control thread for control socket and creates a new worker thread for every worker socket. Again each worker socket creates a new thread to handle every callback that is registered under ‘DefaultHook’. Finally each callback thread creates its own maapi socket connection. But, maapi_set_elem2() call still hangs and does not return.
Can you please let me know if I’m missing something? How should I model my hook implementation so that it can trigger one callback from within another callback: both registered under same call-point, and execute both of them concurrently?
Thanks in advance.
ConfD version: 6.5.9