Thanks Anil. I was able to change the timeout value through the code and its 
working fine.

Regards
-Satish

From: Anil Vishnoi [mailto:vishnoia...@gmail.com]
Sent: Tuesday, May 16, 2017 7:50 AM
To: Michael Vorburger <vorbur...@redhat.com>
Cc: Satish Dutt <sd...@advaoptical.com>; controller-dev@lists.opendaylight.org; 
mdsal-...@lists.opendaylight.org
Subject: Re: [controller-dev] [mdsal-dev] How to increase the timeout value for 
a commit operation to the data store ?

I believe this is where it is set

https://github.com/opendaylight/controller/blob/master/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java#L106

Not sure if there is any way to configure it though any akka/cluster config 
knob.

On Mon, May 15, 2017 at 8:23 AM, Michael Vorburger 
<vorbur...@redhat.com<mailto:vorbur...@redhat.com>> wrote:
On Mon, May 15, 2017 at 5:06 PM, Satish Dutt 
<sd...@advaoptical.com<mailto:sd...@advaoptical.com>> wrote:
Hi Michael,

Thanks for your response. I am writing a custom cohort class for some 
validation purpose, which extends the DOMDataTreeCommitCohort of the 
mdsal.dom.api package and overrides the canCommit(). canCommit() in my cohort 
does some validations and just return a Future object indicating success or 
failure. I am NOT actually timing out the Future . Sometimes my cohort class 
takes more than 5 seconds to execute and the MDSAL commit times-out.

Oh you didn't specify that in your first email... sorry, I don't know anything 
more about this; maybe others will chime in.

I  suspect  that some classes in MDSAL are probably timing out the commit, 
since it is exceeding the default timeout value of 5 seconds. But in my 
application, I can wait for more than 5 seconds possibly around 20 seconds for 
doing the validation. For this I want to know the code of the MDSAL which I can 
tweak for setting a higher timeout value and use that code locally in my 
application.

  "errors": {
    "error": [
      {
        "error-type": "application",
        "error-tag": "operation-failed",
        "error-message": "canCommit encountered an unexpected failure",
        "error-info": "java.util.concurrent.TimeoutException: Futures timed out 
after [5 seconds]\n\tat 
scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)\n\tat 
scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)\n\tat 
scala.concurrent.Await$$anonfun$result$1.apply(package.scala:190)\n\tat 
akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread$$anon$3.block(ThreadPoolBuilder.scala:167)\n\tat
 
scala.concurrent.forkjoin.ForkJoinPool.managedBlock(ForkJoinPool.java:3640)\n\tat
 
akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread.blockOn(ThreadPoolBuilder.scala:165)\n\tat
 scala.concurrent.Await$.result(package.scala:190)\n\tat 
scala.concurrent.Await.result(package.scala)\n\tat 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.CompositeDataTreeCohort.processResponses(CompositeDataTreeCohort.java:162)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.CompositeDataTreeCohort.canCommit(CompositeDataTreeCohort.java:122)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.SimpleShardDataTreeCohort.userPreCommit(SimpleShardDataTreeCohort.java:162)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardDataTree.startPreCommit(ShardDataTree.java:584)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.SimpleShardDataTreeCohort.preCommit(SimpleShardDataTreeCohort.java:91)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.CohortEntry.pr<http://uster.datastore.CohortEntry.pr>eCommit(CohortEntry.java:102)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator.doCommit(ShardCommitCoordinator.java:296)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator.access$200(ShardCommitCoordinator.java:49)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator$2.onSuccess(ShardCommitCoordinator.java:243)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator$2.onSuccess(ShardCommitCoordinator.java:237)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.SimpleShardDataTreeCohort.successfulCanCommit(SimpleShardDataTreeCohort.java:145)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardDataTree.processNextTransaction(ShardDataTree.java:526)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardDataTree.startCanCommit(ShardDataTree.java:560)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.SimpleShardDataTreeCohort.canCommit(SimpleShardDataTreeCohort.java:81)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.CohortEntry.ca<http://uster.datastore.CohortEntry.ca>nCommit(CohortEntry.java:98)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator.handleCanCommit(ShardCommitCoordinator.java:237)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.ShardCommitCoordinator.handleReadyLocalTransaction(ShardCommitCoordinator.java:201)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.Shard.handleReadyLocalTransaction(Shard.java:437)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.datastore.Shard.handleNonRaftCommand(Shard.java:243)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.raft.RaftActor.handleCommand(RaftActor.java:291)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.common.actor.AbstractUntypedPersistentActor.onReceiveCommand(AbstractUntypedPersistentActor.java:29)\n\tat
 
akka.persistence.UntypedPersistentActor.onReceive(PersistentActor.scala:170)\n\tat
 
org.opendaylight.controller.cl<http://org.opendaylight.controller.cl>uster.common.actor.MeteringBehavior.apply(MeteringBehavior.java:97)\n\tat
 akka.actor.ActorCell$$anonfun$become$1.applyOrElse(ActorCell.scala:544)\n\tat 
akka.actor.Actor$class.aroundReceive(Actor.scala:484)\n\tat 
akka.persistence.UntypedPersistentActor.akka$persistence$Eventsourced$$super$aroundReceive(PersistentActor.scala:168)\n\tat
 
akka.persistence.Eventsourced$$anon$1.stateReceive(Eventsourced.scala:633)\n\tat
 
akka.persistence.Eventsourced$class.aroundReceive(Eventsourced.scala:179)\n\tat 
akka.persistence.UntypedPersistentActor.aroundReceive(PersistentActor.scala:168)\n\tat
 akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)\n\tat 
akka.actor.ActorCell.invoke(ActorCell.scala:495)\n\tat 
akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)\n\tat 
akka.dispatch.Mailbox.run(Mailbox.scala:224)\n\tat 
akka.dispatch.Mailbox.exec(Mailbox.scala:234)\n\tat 
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\n\tat 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\n\tat
 scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\n\tat 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)\n"
      }
    ]
  }
}

Regards
-Satish


From: Michael Vorburger 
[mailto:vorbur...@redhat.com<mailto:vorbur...@redhat.com>]
Sent: Monday, May 15, 2017 8:10 PM
To: Satish Dutt <sd...@advaoptical.com<mailto:sd...@advaoptical.com>>
Cc: mdsal-...@lists.opendaylight.org<mailto:mdsal-...@lists.opendaylight.org>; 
controller-dev@lists.opendaylight.org<mailto:controller-dev@lists.opendaylight.org>
Subject: Re: [mdsal-dev] How to increase the timeout value for a commit 
operation to the data store ?

Satish,

On Mon, May 15, 2017 at 2:26 PM, Satish Dutt 
<sd...@advaoptical.com<mailto:sd...@advaoptical.com>> wrote:
Hi,

Is there any way to increase the timeout value for a commit operation to the 
datastore ? Sometimes I get timeout value during the commit operation

AFAIK, the 5s timeout you're experience below from a commit to the datastore is 
probably not coming from mdsal (controller) code itself, but from something 
using it .. if I were you I would look more at the code doing the commit - it 
receives a Future in return, and some code in your application is probably 
timing out on that Future - could that be?hh

Tx,
M.
--
Michael Vorburger, Red Hat
vorbur...@redhat.com<mailto:vorbur...@redhat.com> | IRC: vorburger @freenode | 
~ = http://vorburger.ch<http://vorburger.ch/>


{
  "errors": {
    "error": [
      {
        "error-type": "application",
        "error-tag": "operation-failed",
        "error-message": "canCommit encountered an unexpected failure",
        "error-info": "java.util.concurrent.TimeoutException: Futures timed out 
after [5 seconds]\n\tat
                                
scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)\n\tat
         …
         …
         …
                                
akka.dispatch.Mailbox.exec(Mailbox.scala:234)\n\tat 
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\n\tat 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\n\tat
                                
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\n\tat 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)\n"
      }
    ]
  }
}

Regards
-Satish


_______________________________________________
mdsal-dev mailing list
mdsal-...@lists.opendaylight.org<mailto:mdsal-...@lists.opendaylight.org>
https://lists.opendaylight.org/mailman/listinfo/mdsal-dev



_______________________________________________
controller-dev mailing list
controller-dev@lists.opendaylight.org<mailto:controller-dev@lists.opendaylight.org>
https://lists.opendaylight.org/mailman/listinfo/controller-dev



--
Thanks
Anil
_______________________________________________
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to