You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, not really bug report; Our application runs in cluster with three nodes and once (and just once) one of newly spawn instances went completely nuts and following exception has been thrown over and over when executing compiled template callback:
System.IndexOutOfRangeException: Index was outside the bounds of the array.\
at void HandlebarsDotNet.Collections.FixedSizeDictionary<TKey, TValue, TComparer>.AddOrReplace(in TKey key, in TValue value, out EntryIndex<TKey> index)\
at void HandlebarsDotNet.Iterators.ListIterator<T, TValue>.Iterate(in EncodedTextWriter writer, BindingContext context, ChainSegment[] blockParamsVariables, object input, TemplateDelegate template, TemplateDelegate ifEmpty)\
at void HandlebarsDotNet.Compiler.Iterator.Iterate(BindingContext context, EncodedTextWriter writer, ChainSegment[] blockParamsVariables, object target, TemplateDelegate template, TemplateDelegate ifEmpty)\
at void lambda_method674(Closure, ref EncodedTextWriter, BindingContext)\
at HandlebarsTemplate<TextWriter, object, object> HandlebarsDotNet.HandlebarsEnvironment.Compile(TextReader template)+(TextWriter writer, object context, object data) => { } x 2\
at async Task<RenderedEmail> Foo.Services.CompiledTemplateRenderer.Render(...) in /builds/leapp/src/Foo/Services/CompiledTemplateRenderer.cs:line 73\
... yada yada yada our app call stack
When I checked source code of FixedSizeDictionary, I couldn't spot any place where runtime could get to such situation. Everything seems to be well protected.
In order to reproduce this issue I tried hard to stress new instances as much as possible, tried to pass invalid input (context data), somewhat malform template, but I couldn't get to same error. Application logs didn't really tell much - my only guess would be that something went wrong during startup and compiled templates - which we hold in cache (and populate that cache at startup) - got corrupted / weren't compiled correctly - but nothing suggested that this was the case.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, not really bug report; Our application runs in cluster with three nodes and once (and just once) one of newly spawn instances went completely nuts and following exception has been thrown over and over when executing compiled template callback:
With
[email protected]
.When I checked source code of
FixedSizeDictionary
, I couldn't spot any place where runtime could get to such situation. Everything seems to be well protected.In order to reproduce this issue I tried hard to stress new instances as much as possible, tried to pass invalid input (context data), somewhat malform template, but I couldn't get to same error. Application logs didn't really tell much - my only guess would be that something went wrong during startup and compiled templates - which we hold in cache (and populate that cache at startup) - got corrupted / weren't compiled correctly - but nothing suggested that this was the case.
Any idea / suggestion what should I check?
Beta Was this translation helpful? Give feedback.
All reactions