New Posts New Posts RSS Feed: Coroutine and Errors
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Coroutine and Errors

 Post Reply Post Reply
Author
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Topic: Coroutine and Errors
    Posted: 01-Jul-2011 at 11:54am
Hi stephenmcd1,
I've been trying to reproduce this issue without success.
Have you tried to write an error handler for each EntityQueryOperation within the coroutine iterator? (rather that just rely on the CoroutineOperation)
 
I know this is additional work, but it'd help isolating which operation is causing the exception:
 
i.e.
 
    private IEnumerable<INotifyCompleted> LoadAllCoroutine() {
 
      var orderdetailsOp = _mgr.OrderDetails.ExecuteAsync();
      orderdetailsOp.Completed += (s, args) => {
        if (args.HasError) {
          // do something
        }
      };
      yield return orderdetailsOp;
      yield return Coroutine.Return(null);
    }
 
By the way, are you executing these queries in parallel?
 
Regards,
   Silvio.
Back to Top
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Posted: 29-Jun-2011 at 3:03pm
We were finally able to move to the latest version (6.1.1.0) a few days ago and I just got this same error.  It seems to be considerably more rare than it used to be but that could just be because of unrelated factors (network speed, etc.).

The details are the same as I reported above.  Unfortunately, since the original exception gets re-thrown without being wrapped, there isn't any stack trace for the original InvalidOpertaionException.

We have a number of Corourtines that all execute around the same time (right when the user logs in) so I haven't been able to isolate the particular coroutine code that is breaking.  But I can confirm that there are still some problems in the latest version :-).
Back to Top
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2011 at 5:24pm
Thanks for the update.  There are some breaking changes in 6.1.0 that are temporarily keeping us from upgrading but we plan to do so relatively soon.  I'll update this forum when we do upgrade and I can do some testing.  Unfortunately, the errors would come up pretty irregularly so I'll probably just have to wait a while after we upgrade and see if the error comes up.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 06-May-2011 at 9:41am
Hi Stephen,
 
DevForce 6.1.0 has bee released.
Can you verify if this issue is still present after the update?
 
Regards,
   Silvio.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 9:25am
Hi Stephen,
 
Could you send me your coroutine code?
We have found an issue that throws similar exception.
While the bug we found has been fixed (and the fix will be present in the next release), I'd like to know if your failing code is similar to the one we reproduced the issue.
 
Silvio.
Back to Top
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Posted: 25-Apr-2011 at 3:26pm

We are experiencing intermittent errors when executing some queries using Coroutines.  The trouble is, the stack trace of the error is being overwritten because of the way the CoroutineOperation.HandleError() works.  If there is an exception, it is rethrown but it doesn't wrap the exception so the stack trace gets blown away.

For example, below are the details of an exception we just recieved.  The error message isn't terribly helpful and since we don't know what code originally threw the exception it is even harder to track down.

I guess my question is in two parts.  First, can the error handling code be enhanced a bit to preserve the original stack trace (I think that is how I normally see DevForce do it).  Then secondly, do you have any idea why I might receive an error like the one below?  I don't have a lot of context because the exception is so vague and there isn't any of my actual code on the stack trace so I don't know what kind of query started this off.  Any guidance would be appreciated.

Exception Type: System.InvalidOperationException
Message: Collection was modified; enumeration operation may not execute.
StackTrace:
at IdeaBlade.EntityModel.CoroutineOperation.HandleError(INotifyCompletedArgs notifyCompletedArgs)
at IdeaBlade.EntityModel.CoroutineOperation.OnCompleted(INotifyCompletedArgs notifyCompletedArgs)
at IdeaBlade.EntityModel.CoroutineParallelProcessor.CompletionItem.HandleCompleted(INotifyCompletedArgs args)
at IdeaBlade.EntityModel.BaseOperation.BaseOnCompleted()
at IdeaBlade.EntityModel.BaseOperation`2.OnCompleted()
at IdeaBlade.EntityModel.BaseOperation`2.IdeaBlade.EntityModel.IHasAsyncEventArgs.OnCompleted()
at IdeaBlade.EntityModel.AsyncProcessor`1.<>c__DisplayClass2.<.ctor>b__0(TArgs args)
at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()
at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down