-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check whether Terracotta is running in multithreaded context #285
Comments
Do you have a full traceback? |
I forgot to mention that I am experimenting with deploying TC on Azure Functions, and im seeing these errors when trying to deploy and debug locally. I didnt think to try and serve from TC itself before now, but I can confirm that
|
Is the Azure environment using multithreading under the hood? I have a hard time seeing how this could occur without race conditions. |
Lo and behold, that was the exact issue. Here is the setting for managing the thread count for any future reference, thanks @dionhaefner 🙏 |
Glad it's solved. Let's be more defensive and add a check for this. |
I am seeing some weird behaviour when trying to use the
RelationalMetaStore
class, specifically the db connection handling. Since the connection is created once andyield
ed down the call stack it seems we might run into some issues when trying to do thecommit
or the rollback if any of the downstream calls errored out. We essentially end up with a lot ofAttributeError: 'NoneType' object has no attribute 'rollback'/'commit'
, which seems weird to me since these are only set toNone
in thefinally
block in the top-mostconnect
call.I tried adding a little
if self.connected:
check before commiting or rollbacking which seems to reduce errors and smooth loading of the PNGs, but that seems a little icky since we are in aif not self.connected
loop.Am I looking at this wrong? Has anyone tried using the
RelationalMetaStore
implementation and seen/not seen this before? I tried thinking about a reproducible example but I am struggling to figure out how that could be done.The text was updated successfully, but these errors were encountered: