RavenDB 3 - Lazy Bug

104 views
Skip to first unread message

Daniel Ferreira Monteiro Alves

unread,
Jul 28, 2014, 10:51:46 PM7/28/14
to rav...@googlegroups.com
When using multiple lazy loads with includes, the ravendb 3 raises an exception, this does not occur with the version 2.

Example of code:

Lazy<ExternalAccountLink> lazyLink = _documentSession.Advanced.Lazily
               
.Include<ExternalAccountLink>(x => x.AccountId)
               
.Load(externalLinkId);

Lazy<ExternalEvaluatorLink> lazyLink2 = _session.Advanced.Lazily
               
.Include<ExternalEvaluatorLink>(x => x.EvaluatorId)
               
.Load(externalLinkId);

The exception:


[Error] 2014-07-28 23:44:39.3203 Beedrone.Core.Logging.LoggerFactory Erro durante captura de dados externos System.InvalidOperationException: Url: "/databases/BeeDrone/multi_get?parallel=yes"

System.ArgumentException: Já foi adicionado um item com a mesma chave.
   em
System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   em Raven.Database.Server.Controllers.MultiGetController.<MultiGet>d__5.MoveNext() na c:\Builds\RavenDB-3.0-Pre\Raven.Database\Server\Controllers\MultiGetController.cs:linha 52
--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
   em System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   em System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`
1.MoveNext()
--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
   em
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   em
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   em
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   em System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
   em System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   em System.Runtime.CompilerServices.TaskAwaiter`
1.GetResult()
   em
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
   em
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   em
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   em
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   em System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
 ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`
1 getResponse)
   
--- End of inner exception stack trace ---
   at
Raven.Client.Connection.HttpJsonRequest.HandleErrors(WebException e)
   at
Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getResponse)
   at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
   at Raven.Client.Connection.ServerClient.<>c__DisplayClassbd.<MultiGet>b__bb(OperationMetadata operationMetadata)
   at Raven.Client.Connection.ReplicationInformer.TryOperation[T](Func`
2 operation, OperationMetadata operationMetadata, OperationMetadata primaryOperationMetadata, Boolean avoidThrowing, T& result, Boolean& wasTimeout)
   at
Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication[T](String method, String primaryUrl, OperationCredentials primaryCredentials, Int32 currentRequest, Int32 currentReadStripingBase, Func`2 operation)
   at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`
2 operation)
   at
Raven.Client.Document.DocumentSession.ExecuteLazyOperationsSingleStep()
   at
Raven.Client.Document.DocumentSession.ExecuteAllPendingLazyOperations()
   at
Beedrone.Interop.Guibee.Capturers.GuibeeEvaluationSource.GetEvaluations(IDocumentSession documentSession, IAccountManager accountManager, IEvaluatorManager evaluatorManager) in z:\Requisito\req_beedrone\BeeDrone\Beedrone.Interop.Guibee\Capturers\GuibeeEvaluationSource.cs:line 62
   at
Beedrone.Commands.Synthesizing.Internal.SynthesizeEvaluationCommandGenerator.GenerateCommands(IEvaluationSource source) in z:\Requisito\req_beedrone\BeeDrone\Beedrone.Commands.Synthesizing\Internal\SynthesizeEvaluationCommandGenerator.cs:line 45
   at
Beedrone.Commands.Synthesizing.Internal.ExternalEvaluationCapturingProcess.GetEvaluations(IEvaluationSource source) in z:\Requisito\req_beedrone\BeeDrone\Beedrone.Commands.Synthesizing\Internal\ExternalEvaluationCapturingProcess.cs:line 74

Daniel Ferreira Monteiro Alves

unread,
Jul 28, 2014, 10:54:49 PM7/28/14
to rav...@googlegroups.com
Messages in PT-BR (Brazilian portuguese), if you need to translate. :)

The exception message in english is something like "An item with the same key was already inserted into the list"

Oren Eini (Ayende Rahien)

unread,
Jul 29, 2014, 2:47:24 AM7/29/14
to ravendb
Can you send us a failing test?



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811





--
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.

Daniel Ferreira Monteiro Alves

unread,
Jul 30, 2014, 6:32:41 PM7/30/14
to rav...@googlegroups.com
Ok, I will try to generate the test and send you.

Daniel Ferreira Monteiro Alves

unread,
Jul 30, 2014, 7:07:14 PM7/30/14
to rav...@googlegroups.com
I reproduced the problem with a test case. It is attached.


Em terça-feira, 29 de julho de 2014 03h47min24s UTC-3, Oren Eini escreveu:
RavenBug.7z

Oren Eini (Ayende Rahien)

unread,
Jul 31, 2014, 3:18:40 AM7/31/14
to ravendb
Hi,
I can't make it fail on 3.0.
See attached test.
LazyBug.cs

Daniel Ferreira Monteiro Alves

unread,
Jul 31, 2014, 1:49:36 PM7/31/14
to rav...@googlegroups.com
Your test is running on server or in memory?

Apparently, is the same here. I tested with build 3346. I will try another one.

Oren Eini (Ayende Rahien)

unread,
Aug 1, 2014, 1:52:47 AM8/1/14
to ravendb
I tried both

Daniel Ferreira Monteiro Alves

unread,
Aug 1, 2014, 2:47:40 PM8/1/14
to rav...@googlegroups.com
That is strange because I created a new project just to execute this test and the problem is there... I just tried with two different machines and it is there.

My Windows version is 8.1.
raven-lazy-screenshot.zip

Oren Eini (Ayende Rahien)

unread,
Aug 1, 2014, 5:25:31 PM8/1/14
to ravendb

What build?

Daniel Ferreira Monteiro Alves

unread,
Aug 3, 2014, 5:58:44 PM8/3/14
to rav...@googlegroups.com
Sorry about the late.

I tried the RavenDB 3 Build 3346 and the last one 3361, but today at home I found the problem. The client is incompatible, at least with this feature, between versions 2 and 3.

If I use the RavenDB 3 server with the nuget client (version 2), then the problem occurs. If I change the client manually to the Client 3, it works.


I will post another problem that I found when working with lazy, include on queries later.

Oren Eini (Ayende Rahien)

unread,
Aug 4, 2014, 2:18:27 AM8/4/14
to ravendb
Reproduced, this is a problem in the 3.0 server, looking into this, and will be fixed in the next build.
Reply all
Reply to author
Forward
0 new messages