Problem where assemblies seem to be unloaded during Azure Function scale out

86 Views Asked by At

I have an Azure Functions project which has been working well for months and months, and now just started getting a strange problem.

At first, when requests start getting handled (via Event Hub and Event Grid triggers) things are fine.

In my logs, I can see this works correctly in other cases, but after a few minutes of running, it starts failing - but even more weirdly, in a case where I receive a batch of 10 Event Hub messages in my function, the first 2 or 3 fail with this error, but the rest succeed.

Seems like there's a delay loading assemblies, as it starts to scale instances, maybe?

Seem familiar to anyone?

    Type specified in JSON 'Candela.Frameworks.Knowledge.Models.EntityCommand`2[[Schema.NET.Place, Schema.NET, Version=7.0.0.0, Culture=neutral, PublicKeyToken=fc5550082a9c642c],[Candela.Frameworks.Knowledge.Models.Place, Candela.Frameworks.Knowledge.Models, Version=2020.10.11.5, Culture=neutral, PublicKeyToken=null]], Candela.Frameworks.Knowledge.Models, Version=2020.10.11.5, Culture=neutral, PublicKeyToken=null' is not compatible with 'Candela.Frameworks.Knowledge.Models.EntityCommandBase, Candela.Frameworks.Knowledge.Models, Version=2020.10.11.5, Culture=neutral, PublicKeyToken=null'. Path 'commands[4].$type', line 1, position 2771.
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
       at Candela.Frameworks.Common.Helpers.FromJsonStream[T](ILogger logger, Stream stream) 
0

There are 0 best solutions below