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, if we have an application that is using any derived type from RazorTemplateBase, and using the application wrapper as described in the documentation (link to doc), for instance, if there would be a case where two threads try generating output based on a template, with different model data, if one thread for instance fails, and the other passes, that might result in a case where the ErrorMessage string would potentially be overwritten to null for the thread that failed, or it would have been overwritten with incorrect error message in the thread that succeeded in making a valid response? And then when accessing ErrorMessage we might not be able to access the reason why template generation failed.
This is all theoretical and I haven't observed such a a situation when using this library so far.
What would you suggest to be able to avoid such thread safety issues that might occur?
I am thinking of two things:
Either using all the HostContainers in a Object pool
Or maybe wrapping ErrorMessage in a lock statement?
In any case, thanks for any feedback provided.
The text was updated successfully, but these errors were encountered:
Hi, if we have an application that is using any derived type from RazorTemplateBase, and using the application wrapper as described in the documentation (link to doc), for instance, if there would be a case where two threads try generating output based on a template, with different model data, if one thread for instance fails, and the other passes, that might result in a case where the ErrorMessage string would potentially be overwritten to null for the thread that failed, or it would have been overwritten with incorrect error message in the thread that succeeded in making a valid response? And then when accessing ErrorMessage we might not be able to access the reason why template generation failed.
This is all theoretical and I haven't observed such a a situation when using this library so far.
What would you suggest to be able to avoid such thread safety issues that might occur?
I am thinking of two things:
In any case, thanks for any feedback provided.
The text was updated successfully, but these errors were encountered: