[CONTROLLER-299] MD-SAL datastore does not defer work to other threads or thread pools Created: 09/Apr/14 Updated: 25/Jul/23 Resolved: 30/May/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | mdsal |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Zoltan Lajos Kis | Assignee: | Mayank Agarwal |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| External issue ID: | 703 |
| Description |
|
It seems like this code results in a deadlock: public void onDataChanged(DataChangeEvent<InstanceIdentifier<?>, DataObject> change) { Which suggests that the call to commit() does not defer the execution to a separate thread (or thread pool), but wants to execute it on the caller thread. Despite the fact that commit() returns a Future, which suggests it to be async. I understand that I can work around this by manipulating threads on my own (explicitly spawning, JDKFutures, etc.). However, I believe the current behavior is against the "principle of least astonishment", and should be fixed. Or if this is the designed behavior, it should be clearly documented. Use the attached bundle to reproduce. Once the system is stable, execute ./runme, which will trigger the data change event. That in turn will start a new transaction, and wait for it's result... Also see this thread on the topic: |
| Comments |
| Comment by Zoltan Lajos Kis [ 09/Apr/14 ] |
|
Attachment mdsaltest.tar.gz has been added with description: test bundle for creating deadlock |
| Comment by Mayank Agarwal [ 30/May/14 ] |
|
Email discussion based on which this bug is being marked as Resolved. |
| Comment by Mayank Agarwal [ 30/May/14 ] |
|
Attachment RE- [controller-dev] MD-SAL data store threading model.eml has been added with description: Email discussion |