Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JasperFx" Version="1.6.0-alpha-4" />
<PackageReference Include="JasperFx" Version="1.9.0" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Nuke.Common" Version="8.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/LinqTestsTypes/LinqTestsTypes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

<ItemGroup>
<PackageReference Include="FSharp.Core" Version="9.0.100" />
<PackageReference Include="JasperFx" Version="1.6.0-alpha-4" />
<PackageReference Include="JasperFx" Version="1.9.0" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions src/Marten/DocumentStore.EventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ public async ValueTask<IProjectionBatch<IDocumentOperations, IQuerySession>> Sta
ShouldApplyListeners = mode == ShardExecutionMode.Continuous && range.Events.Any()
};

if (mode == ShardExecutionMode.Continuous)
{
await batch.SpinUpMessageBatchAsync(session).ConfigureAwait(false);
}

var projectionBatch = new ProjectionBatch(session, batch, mode);

if (range.SequenceFloor == 0)
{
await batch.Queue.PostAsync(new InsertProjectionProgress(session.Options.EventGraph, range)).ConfigureAwait(false);
Expand Down
2 changes: 0 additions & 2 deletions src/Marten/Events/Daemon/Internals/ProjectionBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public IProjectionStorage<TDoc, TId> ProjectionStorageFor<TDoc, TId>(string tena
return new ProjectionStorage<TDoc, TId>((DocumentSessionBase)session, storage);
}

//TODO fix in IProjectionBatch

public IProjectionStorage<TDoc, TId> ProjectionStorageFor<TDoc, TId>() where TDoc : notnull where TId : notnull
{
var storage = _session.StorageFor<TDoc, TId>();
Expand Down
8 changes: 8 additions & 0 deletions src/Marten/Events/Daemon/Internals/ProjectionUpdateBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ public async ValueTask<IMessageBatch> CurrentMessageBatch(DocumentSessionBase se
return _batch;
}

// The semaphore is being sensitive to race conditions, so let's try to alleviate that
await Task.Delay(Random.Shared.Next(25, 200).Milliseconds(), _token).ConfigureAwait(false);
await _semaphore.WaitAsync(_token).ConfigureAwait(false);

if (_batch != null)
Expand All @@ -392,4 +394,10 @@ public async ValueTask<IMessageBatch> CurrentMessageBatch(DocumentSessionBase se
_semaphore.Release();
}
}

public async Task SpinUpMessageBatchAsync(DocumentSessionBase session)
{
_batch = await _session.Options.Events.MessageOutbox.CreateBatch(session).ConfigureAwait(false);
Listeners.Add(_batch);
}
}
4 changes: 2 additions & 2 deletions src/Marten/Marten.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="9.0.100" />
<PackageReference Include="Weasel.Postgresql" Version="8.2.0" />
<PackageReference Include="JasperFx" Version="1.8.1" />
<PackageReference Include="JasperFx.Events" Version="1.10.1" />
<PackageReference Include="JasperFx" Version="1.9.0" />
<PackageReference Include="JasperFx.Events" Version="1.10.2" />
<PackageReference Include="JasperFx.RuntimeCompiler" Version="4.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!-- This is forced by Npgsql peer dependency -->
Expand Down
Loading