System.Threading.Tasks.TaskCanceledException: A task was canceled

2,528 views
Skip to first unread message

Matthias De Ridder

unread,
Jul 27, 2015, 3:46:34 AM7/27/15
to RavenDB - 2nd generation document database
We have a baseline server which we use to execute tests on our development code. These tests are executed every day. The create a new database, import a lot of data after which the tests are executed.

Since last week, we receive a lot of these exceptions during our data import:

[System.Threading.Tasks.TaskCanceledException]
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Raven.Client.Extensions.TaskExtensions2.ResultUnwrap[T](Task`1 task) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Extensions\TaskExtensions2.cs:line 59
   at Raven.Client.Connection.ServerClient.Batch(IEnumerable`1 commandDatas) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\ServerClient.cs:line 295
   at Raven.Client.Document.DocumentSession.SaveChanges() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Document\DocumentSession.cs:line 715

We are using the 3684 unstable version. When we are receiving this error, we are trying to save batches of 128 documents to the database. We googled if there was already a solution for this error, but we only found this mention so far.

Is this a known issue? What is causing this exception? Is there a way to solve this?

Maxim Buryak

unread,
Jul 27, 2015, 4:23:01 AM7/27/15
to rav...@googlegroups.com



Best Regards,

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Maxim Buryak l Core Team Developer Mobile:+972-54-217-7751

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/  



--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthias De Ridder

unread,
Jul 27, 2015, 4:47:30 AM7/27/15
to RavenDB - 2nd generation document database, ma...@ravendb.net
Yes, of course. I will post them as soon as possible.

I want to add we installed the latest unstable and encountered the same exception.

Op maandag 27 juli 2015 10:23:01 UTC+2 schreef Maxim Buryak:

Oren Eini (Ayende Rahien)

unread,
Jul 27, 2015, 4:52:19 AM7/27/15
to ravendb, Maxim Buryak
This is usually an indication of a timeout.
Are you updating a document that is being referenced by a lot of LoadDocument?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Matthias De Ridder

unread,
Jul 27, 2015, 4:59:10 AM7/27/15
to RavenDB - 2nd generation document database, ma...@ravendb.net, aye...@ayende.com
We are creating a new database. In the steps where the exception occurs, the documents are inserted for the first time.

Op maandag 27 juli 2015 10:52:19 UTC+2 schreef Oren Eini:

Oren Eini (Ayende Rahien)

unread,
Jul 27, 2015, 5:04:27 AM7/27/15
to Matthias De Ridder, RavenDB - 2nd generation document database, Maxim Buryak

Matthias De Ridder

unread,
Jul 27, 2015, 6:29:21 AM7/27/15
to RavenDB - 2nd generation document database, ma...@ravendb.net, aye...@ayende.com
I don't think so. We receive the exception after the database is created and is already populated with 1,000,000+ documents. The exception always occurs in the same step, but at random intervals. 

I have run the I/O test and these are our result. I'm currently importing the data again with the NLog configuration activated.


Oren Eini (Ayende Rahien)

unread,
Jul 27, 2015, 6:35:46 AM7/27/15
to Matthias De Ridder, RavenDB - 2nd generation document database, Maxim Buryak
Can you pipe this through Fiddler?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


Matthias De Ridder

unread,
Jul 27, 2015, 6:40:14 AM7/27/15
to Oren Eini (Ayende Rahien), RavenDB - 2nd generation document database, Maxim Buryak
I assume you mean our baseline test? I'll look to set it up.

What exactly are you looking for from Fiddler?

Oren Eini (Ayende Rahien)

unread,
Jul 27, 2015, 6:42:01 AM7/27/15
to Matthias De Ridder (Google Drive), RavenDB - 2nd generation document database, Maxim Buryak
To see what the responses are over the wire

Matthias De Ridder

unread,
Jul 27, 2015, 7:52:20 AM7/27/15
to Oren Eini (Ayende Rahien), RavenDB - 2nd generation document database, Maxim Buryak
This is the log and capture from when the error occurred. From what I can see, the log does not show a lot of information. In the capture file, request id 5720 and up are the ones that went wrong.



2015-07-27.log

Oren Eini (Ayende Rahien)

unread,
Jul 27, 2015, 8:22:47 AM7/27/15
to Matthias De Ridder, RavenDB - 2nd generation document database, Maxim Buryak
You are saving 12 - 14 MB in each request, and they complete in about 30 seconds each.

That is what is causing the timeout exception. Try using a smaller batch size, 32, for example. Or using bulk insert.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


Matthias De Ridder

unread,
Jul 27, 2015, 8:33:31 AM7/27/15
to RavenDB - 2nd generation document database, matthi...@gmail.com, ma...@ravendb.net, aye...@ayende.com
Thank you. We will give it a try.

Op maandag 27 juli 2015 14:22:47 UTC+2 schreef Oren Eini:

Kamran Ayub

unread,
Aug 5, 2015, 11:19:19 PM8/5/15
to RavenDB - 2nd generation document database
On this note Oren, is it possible for Raven to write this info to Trace? Request size and duration... would help with debugging these issues on a non-local machine.

Oren Eini (Ayende Rahien)

unread,
Aug 6, 2015, 4:56:13 AM8/6/15
to ravendb

Kamran Ayub

unread,
Aug 6, 2015, 9:22:02 AM8/6/15
to ravendb
Awesome, thank you.

You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/2SsGdQ0waPU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages