OrleansContrib / Orleans.Clustering.Kubernetes

Orleans Membership provider for Kubernetes
MIT License
188 stars 47 forks source link

Fix: Orleans.Hosting.KubernetesHosting: System.MissingMethodException #55

Closed highlyunavailable closed 2 years ago

highlyunavailable commented 3 years ago

Multiple Kubernetes client updates have changed the method signatures and when using a newer version of the client (e.g. when using KubeOps in conjunction with Orleans in the same app) the following error is thrown:

Unhandled exception. System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<System.Object> k8s.KubernetesExtensions.CreateNamespacedCustomObjectAsync(k8s.IKubernetes, System.Object, System.String, System.String, System.String, System.String, System.String, System.Threading.CancellationToken)'.
    at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
    at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()
    at Orleans.Clustering.Kubernetes.KubeMembershipTable.InitializeMembershipTable(Boolean tryInitTableVersion)
    at Orleans.Runtime.MembershipService.MembershipTableManager.Start()

The fix is to upgrade the Kubernetes C# SDK to the latest version, and I have a PR in with the Orleans repo (https://github.com/dotnet/orleans/pull/7346) to do that as well as a PR ready for this repo once I see the disposition of their fix timing but both Orleans.Hosting.Kubernetes and Orleans.Clustering.Kubernetes should to be upgraded to match versions and move in lockstep so one doesn't drag the other down into an incompatible state.

JonathonCwik commented 2 years ago

Would like to bump this and ask if there's a work-around without the update?

highlyunavailable commented 2 years ago

I'm not sure how to get my fix merged (maybe @galvesribeiro can comment?), but there's no real workaround - I've forked locally and done a manual upgrade and just build my own copy of this with my project.

chillitom commented 2 years ago

Related: https://github.com/dotnet/orleans/issues/7406

Sounds like it would be sensible to open a PR against dotnet/orleans to merge this plugin into the main repo and then do the upgrade of client libs.