Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Tom Pantelis
No - as I mentioned the caller must coordinate access.

On Tue, Mar 7, 2017 at 2:06 AM, Satish Dutt  wrote:

> Yes Tom, we are accessing a chain concurrently. Is there any waiting
> mechanism provided by the transaction chain such that the transaction chain
> waits for allocating a new one till the previous write transaction is
> submitted ?
>
>
>
> Regards
>
> -Satish
>
>
>
> *From:* Tom Pantelis [mailto:tompante...@gmail.com]
> *Sent:* Tuesday, March 07, 2017 2:38 AM
> *To:* Satish Dutt 
> *Cc:* Robert Varga ; controller-us...@lists.opendaylight.org;
> controller-dev@lists.opendaylight.org
>
> *Subject:* Re: [controller-dev] Getting exception when using Transaction
> Chain
>
>
>
> It seems you're trying to access a chain concurrently? If so, this is not
> supported. You must coordinate access to the chain such that the previous
> write transaction is submitted before you allocate a new one.
>
>
>
> Tom
>
>
>
> On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt  wrote:
>
> Thanks Robert for the clarification. So to solve the issue, can I handle
> this IllegalStateException and retry the read or write operations for a
> finite number of times, which makes the best effort of previous
> write-capable transactions to get completed. Or is there a more elegant way
> of solving this issue ?
>
> Regards
> -Satish
>
>
> -Original Message-
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Monday, March 06, 2017 5:23 PM
> To: Satish Dutt ; controller-users@lists.
> opendaylight.org; controller-dev@lists.opendaylight.org
> Subject: Re: [controller-dev] Getting exception when using Transaction
> Chain
>
> On 03/06/2017 12:39 PM, Satish Dutt wrote:
> > When multiple requests are sent concurrently, IllegalStateException is
> > thrown. Is there any way to solve this issue, apart from synchronizing
> > the method which does the above operations ?
>
> This is actually part of the API contract:
>
> https://github.com/opendaylight/controller/blob/
> a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-
> sal/sal-common-api/src/main/java/org/opendaylight/
> controller/md/sal/common/api/data/TransactionChain.java#L59
>
> The reason is very simple: if there is a write-capable transaction open
> and it has seen some modifications, does the second transaction observe
> those modifications as applied or as unapplied?
>
> Bye,
> Robert
>
> ___
> controller-dev mailing list
> controller-dev@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
>
>
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Satish Dutt
Yes Tom, we are accessing a chain concurrently. Is there any waiting mechanism 
provided by the transaction chain such that the transaction chain waits for 
allocating a new one till the previous write transaction is submitted ?

Regards
-Satish

From: Tom Pantelis [mailto:tompante...@gmail.com]
Sent: Tuesday, March 07, 2017 2:38 AM
To: Satish Dutt 
Cc: Robert Varga ; controller-us...@lists.opendaylight.org; 
controller-dev@lists.opendaylight.org
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

It seems you're trying to access a chain concurrently? If so, this is not 
supported. You must coordinate access to the chain such that the previous write 
transaction is submitted before you allocate a new one.

Tom

On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt 
> wrote:
Thanks Robert for the clarification. So to solve the issue, can I handle this 
IllegalStateException and retry the read or write operations for a finite 
number of times, which makes the best effort of previous write-capable 
transactions to get completed. Or is there a more elegant way of solving this 
issue ?

Regards
-Satish

-Original Message-
From: Robert Varga [mailto:n...@hq.sk]
Sent: Monday, March 06, 2017 5:23 PM
To: Satish Dutt >; 
controller-us...@lists.opendaylight.org;
 
controller-dev@lists.opendaylight.org
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is
> thrown. Is there any way to solve this issue, apart from synchronizing
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open and it 
has seen some modifications, does the second transaction observe those 
modifications as applied or as unapplied?

Bye,
Robert
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev

___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Tom Pantelis
It seems you're trying to access a chain concurrently? If so, this is not
supported. You must coordinate access to the chain such that the previous
write transaction is submitted before you allocate a new one.

Tom

On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt  wrote:

> Thanks Robert for the clarification. So to solve the issue, can I handle
> this IllegalStateException and retry the read or write operations for a
> finite number of times, which makes the best effort of previous
> write-capable transactions to get completed. Or is there a more elegant way
> of solving this issue ?
>
> Regards
> -Satish
>
> -Original Message-
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Monday, March 06, 2017 5:23 PM
> To: Satish Dutt ; controller-users@lists.
> opendaylight.org; controller-dev@lists.opendaylight.org
> Subject: Re: [controller-dev] Getting exception when using Transaction
> Chain
>
> On 03/06/2017 12:39 PM, Satish Dutt wrote:
> > When multiple requests are sent concurrently, IllegalStateException is
> > thrown. Is there any way to solve this issue, apart from synchronizing
> > the method which does the above operations ?
>
> This is actually part of the API contract:
>
> https://github.com/opendaylight/controller/blob/
> a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-
> sal/sal-common-api/src/main/java/org/opendaylight/
> controller/md/sal/common/api/data/TransactionChain.java#L59
>
> The reason is very simple: if there is a write-capable transaction open
> and it has seen some modifications, does the second transaction observe
> those modifications as applied or as unapplied?
>
> Bye,
> Robert
>
> ___
> controller-dev mailing list
> controller-dev@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Robert Varga
On 03/06/2017 01:05 PM, Satish Dutt wrote:
> Thanks Robert for the clarification. So to solve the issue, can I handle this 
> IllegalStateException and retry the read or write operations for a finite 
> number of times, which makes the best effort of previous write-capable 
> transactions to get completed. Or is there a more elegant way of solving this 
> issue ?

There is now way you can get around that exception. As for a solution,
you have seen
https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L92,
right?

Regards,
Robert



signature.asc
Description: OpenPGP digital signature
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


[controller-dev] bundle "org.opendaylight.controller.blueprint_0.6.0.SNAPSHOT [260]" could not be resolved. Reason: Missing Constraint: Import-Package: org.opendaylight.controller.config.facade.xml

2017-03-06 Thread Michael Vorburger
Hello controller-dev,

do you know what could be causing this new SingleFeatureTest (SFT) failure?

java.lang.IllegalStateException: Can't install feature
odl-netvirt-api/0.4.0-SNAPSHOT:
Could not start bundle
mvn:org.opendaylight.controller/blueprint/0.6.0-SNAPSHOT in feature(s)
odl-mdsal-broker-local-1.5.0-SNAPSHOT: The bundle
"org.opendaylight.controller.blueprint_0.6.0.SNAPSHOT [257]" could not be
resolved. Reason: Missing Constraint: Import-Package:
org.opendaylight.controller.config.facade.xml; version="[0.6.0,1.0.0)"

I'm currently getting this, reproducibly, when doing "rm -rf
~/.m2/repository/org/opendaylight/; mvn clean install" in
netvirt/vpnservice/features ...

Tx,
M.
--
Michael Vorburger  | IRC: vorburger @freenode | ~ =
http://vorburger.ch
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


[controller-dev] RPC flow from NorthBound

2017-03-06 Thread Senthil Balachandran
Hello Team,

   I have an application (let us assume here HelloWorld App only). In that i 
define rpc and register this rpc to RpcProviderRegistry.


Please clarify on this,


1. When i invoke the NB rest API, how the restconf gets the context  of this 
particular provider and invoking this corresponding RPC?

2. Whether this request come to MD-SAL and then RPC is invoked ?


Note: I have added more log message and fed-up with the full flow from RESTCONF 
to Provider RPC (here HelloWorld App). From this i come to know that 
ControllerContext (sal-rest-connector) is playing the major role, but i need 
more info on above two querry.


Reference:https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Startup_Project_Archetype



Thanks & Regards

   Senthil

___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Satish Dutt
Thanks Robert for the clarification. So to solve the issue, can I handle this 
IllegalStateException and retry the read or write operations for a finite 
number of times, which makes the best effort of previous write-capable 
transactions to get completed. Or is there a more elegant way of solving this 
issue ?

Regards
-Satish

-Original Message-
From: Robert Varga [mailto:n...@hq.sk] 
Sent: Monday, March 06, 2017 5:23 PM
To: Satish Dutt ; 
controller-us...@lists.opendaylight.org; controller-dev@lists.opendaylight.org
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is 
> thrown. Is there any way to solve this issue, apart from synchronizing 
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open and it 
has seen some modifications, does the second transaction observe those 
modifications as applied or as unapplied?

Bye,
Robert

___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Robert Varga
On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is
> thrown. Is there any way to solve this issue, apart from synchronizing
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open
and it has seen some modifications, does the second transaction observe
those modifications as applied or as unapplied?

Bye,
Robert



signature.asc
Description: OpenPGP digital signature
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


[controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Satish Dutt
Hi,

In a method we are creating a new instance of ReadOnlyTransaction and 
WriteTransaction from the transaction chain and subsequently doing the read and 
write operations on the datastore. When multiple requests are sent 
concurrently, IllegalStateException is thrown. Is there any way to solve this 
issue, apart from synchronizing the method which does the above operations ?

Method pseudocode :

doSomeTask(BindingTransactionChain txnChain) {
1) final WriteTransaction writeTxn = 
txnChain.newWriteOnlyTransaction();
2) final ReadOnlyTransaction readTxn = 
txnChain.newReadOnlyTransaction();
3) Read the data and close the transaction readTxn.close()
4) Write the data.
}


Exception trace :

java.lang.IllegalStateException: Previous transaction 
member-1-datastore-operational-fe-0-chn-3-txn-1018 is not ready yet
at 
org.opendaylight.controller.cluster.datastore.TransactionChainProxy$Allocated.checkReady(TransactionChainProxy.java:85)
at 
org.opendaylight.controller.cluster.datastore.TransactionChainProxy.allocateWriteTransaction(TransactionChainProxy.java:190)
at 
org.opendaylight.controller.cluster.datastore.TransactionChainProxy.newWriteOnlyTransaction(TransactionChainProxy.java:171)
at 
org.opendaylight.controller.cluster.databroker.DOMBrokerWriteOnlyTransaction.createTransaction(DOMBrokerWriteOnlyTransaction.java:32)
at 
org.opendaylight.controller.cluster.databroker.DOMBrokerWriteOnlyTransaction.createTransaction(DOMBrokerWriteOnlyTransaction.java:16)
at 
org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerTransaction.getSubtransaction(AbstractDOMBrokerTransaction.java:57)
at 
org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.merge(AbstractDOMBrokerWriteTransaction.java:97)
at 
org.opendaylight.controller.md.sal.binding.impl.BindingDOMWriteTransactionAdapter.ensureParentsByMerge(BindingDOMWriteTransactionAdapter.java:67)
at 
org.opendaylight.controller.md.sal.binding.impl.AbstractWriteTransaction.merge(AbstractWriteTransaction.java:55)
at 
com.adva.ensemble.controller.controllerconfiguration.util.NetworkAssignmentHelper.updateManagementIpAddress(NetworkAssignmentHelper.java:234)
at 
com.adva.ensemble.controller.controllerconfiguration.util.NetworkResourcePool.offerMgmtIp(NetworkResourcePool.java:79)
at 
com.adva.ensemble.controller.controllerconfiguration.util.ControllerConfigurationUtil.setMgmtIp(ControllerConfigurationUtil.java:936)
at 
com.adva.ensemble.controller.controllerconfiguration.util.ControllerConfigurationUtil.setManagementIp(ControllerConfigurationUtil.java:1343)
at 
com.adva.ensemble.controller.controllerconfiguration.util.ControllerConfigurationUtil.processCreateOrUpdate(ControllerConfigurationUtil.java:798)
at 
com.adva.ensemble.controller.controllerconfiguration.impl.ConnectorConfigRpcServiceImpl.createConnectorConfig(ConnectorConfigRpcServiceImpl.java:177)
at 
org.opendaylight.yangtools.yang.binding.util.RpcMethodInvokerWithInput.invokeOn(RpcMethodInvokerWithInput.java:30)
at 
org.opendaylight.yangtools.yang.binding.util.AbstractMappedRpcInvoker.invokeRpc(AbstractMappedRpcInvoker.java:52)
at 
org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invoke(BindingDOMRpcImplementationAdapter.java:85)
at 
org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invokeRpc(BindingDOMRpcImplementationAdapter.java:72)
at 
org.opendaylight.controller.md.sal.dom.broker.impl.GlobalDOMRpcRoutingTableEntry.invokeRpc(GlobalDOMRpcRoutingTableEntry.java:39)
at 
org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRoutingTable.invokeRpc(DOMRpcRoutingTable.java:186)
at 
org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter.invokeRpc(DOMRpcRouter.java:131)
at Proxycf92d5e4_0a26_40ab_b779_fd8b6d8a16b2.invokeRpc(Unknown Source)
at 
org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.invokeRpc(BrokerFacade.java:350)[274:org.opendaylight.netconf.sal-rest-connector:1.4.0.Boron]
at 
org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.invokeRpc(RestconfImpl.java:443)[274:org.opendaylight.netconf.sal-rest-connector:1.4.0.Boron]
at 
org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.invokeRpc(StatisticsRestconfServiceWrapper.java:82)[274:org.opendaylight.netconf.sal-rest-connector:1.4.0.Boron]
at 
org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.invokeRpc(RestconfCompositeWrapper.java:64)[274:org.opendaylight.netconf.sal-rest-connector:1.4.0.Boron]
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_102]
at