-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyperion.ValueSerializers.UnsupportedTypeException: No coercion operator is defined between types 'Interop+Sys+SocketEvent*' and 'System.Object'. #5298
Comments
Thanks for the detailed writeup @Swoorup - I'll ask @Arkatufus on our team to take a look at this. Some questions though - the previous bug you alluded to was an error with Akka.IO and actor serialization being turned on. That's definitely fixed. In your case, it looks to me like you're trying to send a message over Akka.Remote that contains a socket inside of it? Am I interpreting that stack trace correctly? |
@Aaronontheweb I don't believe I am sending any messages with socket or but purely F# immutable structures and during initial startup. This seems to occur whenever specifying seed nodes for instance A and B in a cluster setup:
|
@Swoorup looks like this operation fails when we're trying to remotely deploy an actor - do you know which actor it is that might be failing? We should probably update our error message here to make it clearer when the |
@Aaronontheweb ActorStartup.fs let workerPoolRef = spawn system workerPoolActorName (Worker.create workFlow)
// spawn the work manager
spawn system workManagerActorName (WorkManager.create workRepository workerPoolRef) |> ignore WorkManager.fs namespace Domain.Location.Actor.Shared.Actor
open Akkling.ActorRefs
open Domain.Location.Actor.Shared
open Domain.Location.Importer
open Akkling
type WorkManagerMsg = StartWork of param: IWorkFlowCommand
[<RequireQualifiedAccess>]
module WorkManager =
let name = "workManager"
type State = Map<WorkId, IActorRef<WorkerMsgEnv>>
let create (workRepository: IWorkRepository) (workerPool: IActorRef<WorkerMsgEnv>) =
props (fun (mailbox: Actor<WorkManagerMsg>) ->
let rec loop (state: State) =
actor {
let! msg = mailbox.Receive()
match msg with
| StartWork param ->
let workHashKey = Core.getOrCreateWorkHashKey param
let! workId = workRepository.Create(param)
workerPool <! { WorkId = workId; HashKey = workHashKey; Msg = WorkerMsg.StartWork param }
mailbox.Sender() <! workId // respond back with the workId
let state = state.Add(workId, workerPool)
return! loop state
}
loop Map.empty) Worker.fs namespace Domain.Location.Actor.Shared.Actor
open Akka.Routing
open Akkling
open Domain.Location.Actor.Shared
open Domain.Location.Actor.Shared.Core
open Domain.Location.Actor.Shared.Workflow
open Domain.Location.Importer
type WorkerMsg =
| StartWork of param: IWorkFlowCommand
| WorkCompleted
type WorkerMsgEnv =
{ Msg: WorkerMsg
WorkId: WorkId
HashKey: WorkHashKey }
interface IConsistentHashable with
member x.ConsistentHashKey = box x.HashKey
[<RequireQualifiedAccess>]
module Worker =
type State =
| ReadyForWork
| Working of workId: WorkId
let create (workflow: IWorkFlow) =
let compute msgEnv (param: IWorkFlowCommand) =
async {
do! workflow.RunWork msgEnv.WorkId param
return { msgEnv with Msg = WorkCompleted }
}
let props =
props
(fun (mailbox: Actor<WorkerMsgEnv>) ->
let rec ready (state: State) =
actor {
let! msg = mailbox.Receive()
match msg.Msg with
| StartWork param ->
let workId = msg.WorkId
compute msg param |!> mailbox.Self
return! busy (Working workId)
| _ -> return! ready state
}
and busy (state: State) =
actor {
let! msg = mailbox.Receive()
match msg.Msg with
| StartWork _ ->
mailbox.Stash()
return! busy state
| WorkCompleted ->
mailbox.UnstashAll()
return! ready ReadyForWork
}
ready ReadyForWork)
{ props with Router = Some(upcast FromConfig.Instance) } |
Per our conversation in Gitter, I think we've resolved this - problem is caused by a remote deployment of an actor that takes a database connection as a dependency, which can't be serialized. Solution is to not remotely deploy an actor with these constructor requirements directly. |
Version Information
Version of Akka.NET? 1.4.26
Which Akka.NET Modules?
Describe the bug
Same issue as in #4936
Hocon
Details
The text was updated successfully, but these errors were encountered: