RPC hangs on using maapi_apply_trans

  rpcs:
    +---x create-vlan-fc
    |  +---w input
    |  |  +---w affected-vlan-fd?   string
    |  |  +---w new-vlan-id?        uint64
    |  +--ro output
    |     +--ro created-vlan-fc?   string
    +---x delete-vlan-fc
       +---w input
          +---w affected-vlan-fd?   string
          +---w obsolete-vlan-fc?   string

Hi,

Sorry if the question is very basic.

In annotate yang file, mentioned about callback API as below and registered the same during confD init.

    tailf:annotate "/vlan-fd:create-vlan-fc" {
      tailf:actionpoint ap_coremodel_fwd_domain_create_vlan_fc;
    }

    tailf:annotate "/vlan-fd:delete-vlan-fc" {
       tailf:actionpoint ap_coremodel_fwd_domain_delete_vlan_fc;
    }

Inside both callbacks, trying to do create/delete of other (ONF vlan-Fc) leaves and executed maapi_apply_trans(). Here the maapi_apply_trans() API hangs

While debugging further below is from confD user guide

Chapter 11. Actions
11.1. Introduction
When we want to define operations that do not affect the configuration data store, we can use the
tailf:action statement in the YANG data model.

Is it like, we shouldn’t perform any transaction apply from action points given for RPCs?

And, the given RPCs are from ONF standard yang file.

Requesting inputs to proceed further.

Regards,
Chandu

First, using rpcs/actions used as custom non-standard ways of editing the configuration is not best practice and not recommended.

When making changes over MAAPI from an rpc/action, start a new write transaction to make the changes. Regarding the maapi_apply_trans() “hanging”, there could be many reasons for that. A common one is a deadlock where your application is subscribing to changes and committing changes from the same thread/process. Use the ConfD developer log with developerLogLevel set to “trace” to debug the issue.

Hi Cohult.

Thanks for your reply.

yes, from developerLogLevel trace level identified having validation/transhook for other yang files leaves in their respective annotate files triggered hang on RPC maapi_apply_trans API.

Sample log

<DEBUG> 14-Dec-2022::15:58:14.324 My-host confd[119633]: devel-c new_action request daemon id: 0 usid: 24
<DEBUG> 14-Dec-2022::15:58:14.325 My-host confd[119633]: devel-c new_action succeeded daemon id: 0 session id: -34 worker id: 110
<DEBUG> 14-Dec-2022::15:58:14.325 My-host confd[119633]: devel-c action action() request for callpoint ap_coremodel_fwd_domain_delete_vlan_fc path
<DEBUG> 14-Dec-2022::15:58:14.327 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: entering validate phase for running...
<DEBUG> 14-Dec-2022::15:58:14.327 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: validate: grabbing transaction lock...
<DEBUG> 14-Dec-2022::15:58:14.327 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: validate: grabbing transaction lock ok
<DEBUG> 14-Dec-2022::15:58:14.327 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: validate: creating rollback file...
<DEBUG> 14-Dec-2022::15:58:14.330 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: validate: creating rollback file ok
<DEBUG> 14-Dec-2022::15:58:14.330 My-host confd[119633]: confd commit progress db=running usid=26 thandle=61: validate: run transforms and transaction hooks...
<DEBUG> 14-Dec-2022::15:58:14.331 My-host confd[119633]: devel-c new_usess db request daemon id: 0
<DEBUG> 14-Dec-2022::15:58:14.331 My-host confd[119633]: devel-c db reply daemon id: 0
<DEBUG> 14-Dec-2022::15:58:14.332 My-host confd[119633]: devel-c new_trans request daemon id: 0 thandle: 61
<DEBUG> 14-Dec-2022::15:58:14.332 My-host confd[119633]: devel-c new_trans succeeded daemon id: 0 session id: 61 worker id: 110

Where after commenting transhook for other leaf transaction completes and we could see the same in developer log as below

14-Dec-2022::16:07:54.923 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: run transforms and transaction hooks done

Logs after commenting other leaf transhook

<DEBUG> 14-Dec-2022::16:07:54.923 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: run transforms and transaction hooks done
<DEBUG> 14-Dec-2022::16:07:54.923 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: pre validate...
<DEBUG> 14-Dec-2022::16:07:54.924 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: pre validate ok
<DEBUG> 14-Dec-2022::16:07:54.924 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: run validation over the change set...
<DEBUG> 14-Dec-2022::16:07:54.924 My-host confd[124065]: confd commit progress db=running usid=26 thandle=56: validate: validation over the change set done

Since from ONF standard vlan-fd-1-0.yang model expects configuration change will try the mentioned suggestion "start a new write transaction to make the changes."

Thanks for your support.

Regards,
Chandu