Hello,
We have a very strange problem first noticed in our live multi-tenant environment. Each tenant is able to store a number of theme variables, hex colour codes in a database. The bundle transformer code references a .less file and compiles to CSS with these theme variables (ModifyVariables). We noticed one tenant would randomly see theme colours of another tenant.
Back in development and during debugging we made sure on each Application BeginRequest to invalidate the cache and rebuild the theme CSS on every request. With multiple browsers running against different tenants we still found colours would bleed across tenants and across browser sessions.
After an awful lot of debugging and messing with IIS settings we found that the following process occurred in code with the following outcome:
...
LessTranslator is instantiated. This has an empty ModifyVariables property
LessTranslator.ModifyVariables is then updated with our values from the database. This has the correct values at this point
Some asset work occurs
LessTranslator.Translate is called which in turn calls CreateCompilationOptions. The ModifyVariables property now has values from another browser session.
So something is not thread safe, but we cannot work out what. The problem is always seen after an IISReset and we try to access different tenants from different browsers as concurrently as possible, i.e. clicking refresh in each browser as quickly as possible.
Has anyone seen this problem before? What information would you need to help us?
Regards,
Craig
Comments: Taritsyn, I'll have a read over the weekend , thank you. Regards, Craig
We have a very strange problem first noticed in our live multi-tenant environment. Each tenant is able to store a number of theme variables, hex colour codes in a database. The bundle transformer code references a .less file and compiles to CSS with these theme variables (ModifyVariables). We noticed one tenant would randomly see theme colours of another tenant.
Back in development and during debugging we made sure on each Application BeginRequest to invalidate the cache and rebuild the theme CSS on every request. With multiple browsers running against different tenants we still found colours would bleed across tenants and across browser sessions.
After an awful lot of debugging and messing with IIS settings we found that the following process occurred in code with the following outcome:
...
LessTranslator is instantiated. This has an empty ModifyVariables property
LessTranslator.ModifyVariables is then updated with our values from the database. This has the correct values at this point
Some asset work occurs
LessTranslator.Translate is called which in turn calls CreateCompilationOptions. The ModifyVariables property now has values from another browser session.
So something is not thread safe, but we cannot work out what. The problem is always seen after an IISReset and we try to access different tenants from different browsers as concurrently as possible, i.e. clicking refresh in each browser as quickly as possible.
Has anyone seen this problem before? What information would you need to help us?
Regards,
Craig
Comments: Taritsyn, I'll have a read over the weekend , thank you. Regards, Craig