ReubenBond on main
Implement DeleteStateOnClear fo… (compare)
this.GetStreamProvider(..).GetStream<T>(id, namespace)
from within a grain, but you could as well use IClusterClient.GetStreamProvider(..).GetStream(id, namespace)
. What is it that defines that the stream is coupled to the grain, because it seems like the two options does more or less the same thing, but the second doesn't necessarily seemed tied to the grain (if it's not done through the streamId). Please advice me.
Hi, I have a question to confirm understanding of https://dotnet.github.io/orleans/docs/grains/external_tasks_and_grains.html
I want to perform two concurrent asynchronous operations to a) read a record from a database (a record in Postgres) and b) read any related events from an event queue (in this case a list in Redis).
I am unsure of which of these approaches would be best:
Approach A
....grain code...
var tskLoadData = Task.Run(async () =>
{
var tskLoadEntityFromDatabase = LoadEntityFromDatabase(_entityId);
var tskLoadEvents = LoadEvents(_entityId);
await Task.WhenAll(tskLoadEntityFromDatabase, tskLoadEvents);
return new { entity = await tskLoadEntityFromDatabase, events = await tskLoadEvents };
});
var resLoadData = await tskLoadData;
....grain code...
Approach B
....grain code...
var tskLoadEntityFromDatabase = LoadEntityFromDatabase(_entityId);
var tskLoadEvents = LoadEvents(_entityId);
await Task.WhenAll(tskLoadEntityFromDatabase, tskLoadEvents);
var entity = await tskLoadEntityFromDatabase;
var events = await tskLoadEvents;
....grain code...
Is it the correct understanding that in Approach B, tskLoadEntityFromDatabase
and tskLoadEvents
would run sequentially, as they are scheduled on the Orleans turn-based task-scheduler ?
[Serializable]
[GenerateSerializer]
public class DiagnosticsPayload
{
public string CorrelationId { get; set; }
public DateTimeOffset CreatedAt { get; set; }
public int HopCount { get; set; }
public string PreviousGrainName { get; set; }
public string PreviousMethodName { get; set; }
public string GrainName { get; set; }
public string MethodName { get; set; }
public string RequestSource { get; set; }
public override string ToString()
{
if (PreviousMethodName != null)
{
return $"{PreviousGrainName}.{PreviousMethodName} => {GrainName}.{MethodName} ({HopCount}) {CreatedAt.Ticks} {CorrelationId} {RequestSource}";
}
else
{
return $"{GrainName}.{MethodName} ({HopCount}) {CreatedAt.Ticks} {CorrelationId} {RequestSource}";
}
}
}
It doesn't seem to be able to do this.
Hello everyone,
Based on the following reply of @ReubenBond:
@chillitom it's an ignorable internal detail which shouldn't be being logged at info level - ought to change that. It shouldn't affect your application. It usually means that a race occurred and the error is printed by the process which lost the race
I'd like to ask a question
I have few "Failed to forward message {Message} from {OldAddress} to {ForwardingAddress} after Non-existent activation. Attempt 2"
log records and I'm trying to figure out what is going on..
Based on @ReubenBond answer, I assume that having a Non-Existent activation
is quite common and should not be counted as anything special.
My hypothesis is that it may happen twice on the same activation and in such case reach the maximum forwarding attempts count and reject the message.
I assume that bumping up this number (maximum attempts for forwarding) will decrease the chances for it to happen.
My questions are:
Thanks!
I'm trying to figure out performace issues with Orleans. Specifically, I am sending a packet from Unity client to Orleans, to initiate a combat action. Once the packet is received, a hit check is started via a timer (mimics an update loop). This timer performs a raycast hit check via a third-party physics engine.
There is a notable delay between receiving the packet and the commencement of the hit check (and timer), but I'm struggling to figure out what's causing the bottleneck.
I've tried to run the process through a profiler, namely DotNetTrace, but it's difficult to interpret the profile due to the threaded nature of Orleans. I realise you can't help with this specific problem without reviweing our code, however are you able to provide any steps/procedures that can help me with profiling.
Hello, i am new to orleans. i am trying to build a client with .net47.
Have set up on the Hello World program with .net7.
Have changed the interface for grain to netstandard2 for this, the client and silo are unchanged. The interface project has the nuget packages Microsoft.Orleans.Core.Abstractions and Microsoft.Orleans.CodeGenerator.MSBuild.
I get an exception:
Exception while trying to run client: Unable to find an IGrainReferenceActivatorProvider for grain type hello
What I am doing wrong? Thanks for help!