OrleansContrib / Orleans.SyncWork

This package's intention is to expose an abstract base class to allow https://github.com/dotnet/orleans/ to work with long running CPU bound synchronous work, without becoming overloaded.
https://OrleansContrib.github.io/Orleans.SyncWork
MIT License
58 stars 12 forks source link

Usage of SyncWork most of time show this exception System.TypeLoadException: Unable to load Orleans.SyncWork.ISyncWorker`2,Orleans.SyncWork from assembly Orleans.SyncWork #60

Open realkarimfahmy opened 3 weeks ago

realkarimfahmy commented 3 weeks ago

Usage of SyncWork most of the time show this exception

System.TypeLoadException: Unable to load Orleans.SyncWork.ISyncWorker`2,Orleans.SyncWork from assembly Orleans.SyncWork.

I have followed your repo example

Steps to reproduce the behavior:

  1. I downloaded this package to 3 projects (API, Grains, Silo)
    • API code: var jobGrain = _clusterClient.GetGrain<IPasswordVerifierGrain>(Guid.NewGuid()); var result = await jobGrain.StartWorkAndPollUntilResult(request);

2- Grains project has the same implementation as the repo example

  1. Silo project has this usage: .ConfigureSyncWorkAbstraction(Environment.ProcessorCount - 2) // Add this line to configure Orleans.SyncWork

See Result image

image

Kritner commented 3 weeks ago

What is the difference between the two screenshots posted? it's just randomly failing sometimes, and other times not, within the same project, config, runtime, etc?

realkarimfahmy commented 3 weeks ago

Hi @Kritner,

yes the exception in Silo project that references the grain project in the password verifier

the exception is about Unable to load Orleans.SyncWork.ISyncWorker,Orleans.SyncWork from assembly Orleans.SyncWork.

if you have applied the same structure with the password verifier example you will get this exception 1- API 2- Grains 3- Silo

Orleans.SyncWork package installed in API and Silo

Kritner commented 3 weeks ago

i started a PR to add an additional sample https://github.com/OrleansContrib/Orleans.SyncWork/pull/61 while using separate client/silo projects. This does work, though i'm relying on the "project" reference instead of a "package" reference against the orleans.syncwork assembly.

i'm not sure if you'll be able to see any difference in setup, but i'm not really sure how to help w/o a repro