# RPC hangs on using maapi\_apply\_trans

**URL:** <https://dmap-community.ductus.global/t/rpc-hangs-on-using-maapi-apply-trans/4291>\
**Category:** CDB and CDB API\
**Created:** [December 16, 2022, 7:01am UTC](https://dmap-community.ductus.global/t/rpc-hangs-on-using-maapi-apply-trans/4291 "2022-12-16T07:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schandrakanth](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@schandrakanth](https://dmap-community.ductus.global/u/schandrakanth)\
**Post date:** [December 16, 2022, 7:01am UTC](https://dmap-community.ductus.global/t/rpc-hangs-on-using-maapi-apply-trans/4291/1 "2022-12-16T07:01:54Z")

</div>

```auto
  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.

```auto
    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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [December 16, 2022, 1:22pm UTC](https://dmap-community.ductus.global/t/rpc-hangs-on-using-maapi-apply-trans/4291/2 "2022-12-16T13:22:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![schandrakanth](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@schandrakanth](https://dmap-community.ductus.global/u/schandrakanth)\
**Post date:** [December 16, 2022, 2:34pm UTC](https://dmap-community.ductus.global/t/rpc-hangs-on-using-maapi-apply-trans/4291/3 "2022-12-16T14:34:33Z")

</div>

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

```auto
<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**

```auto
<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
