Get_next getting called twicw with -1


ISSUE 1 :-

I am facing an issues where i have a “list” in my yang for operational data.
I have implemented a get_next API for the same.

But the issue is, get_next is being called twice with next as -1. This is causing delays in scale setup.

In my get_next api implementation, if next is -1, I allocate some memory and initiate some data structures. But as this is getting called twice, it is causing issues.

Is there a way I can ignore the first call of get_next with -1 and process the second call of get_next?


As per my understanding, for operational commands transaction init and finish are two hooks which should be called whenever someone executes the show command.
But in my case, transaction init is getting only once and for subsequent execution of show commands this is not getting called.

And transaction finish is never being called.

Can you please explain what could be wrong here?


  1. this is regular behavior, for explanation/details, see related topic here.

Not exactly - these are the procedures that are called whenever new “transaction” is processed.
This is not per each show command, but e.g. per user session logging into CLI (init()) and leaving CLI (finish()).

If you want to have separate transaction for each show command, check the option "/confdConfig/cli/reallocateOperTrans" in ConfD user guide - this will enforce init/finish for a separate show command requests of CLI user.