language file overwritten

34 views
Skip to first unread message

Alex

unread,
Oct 14, 2019, 9:28:31 AM10/14/19
to web2py-users
We have upgraded to the latest web2py version 2.18.5 (from a very old 2.12.3) and also changed from Python 2 to 3.

Most things are working fine but we have one major issue: from time to time a language file gets overwritten. We did not experience this problem before.

In a model file we explicitly set T.is_writable to False. After determining the used language we set the flag:

T.force(session_language)
T
.is_writable = False

When the language file is overwritten usually only one or two labels are added to the file. But sometimes it happens that the language file only contains the new label and then all translations are lost.

How is it possible that web2py overwrites the language file when we set the is_writable flag? are there any possible race conditions as this problem only occurs very rarely?

For now we changed the file owner of the language files to root so web2py cannot corrupt our translation files but of course this is only a temporary workaround. Any ideas?

Alex

Alex

unread,
Oct 24, 2019, 5:46:19 PM10/24/19
to web2py-users
anyone? this is a huge issue causing us serious trouble on our production site.

So far it seems that this only happens on startup when the threads are initialized. There must be some kind of race condition during initialization. It seems to be related to multiple simultaneous requests which are triggered on our pages containing many images. The browser will start many requests at the same time to fetch all the images so this is probably related.

I also experienced this issue a few times locally using the integrated web2py webserver. So this has nothing to do with Apache or mod_wsgi.
Reply all
Reply to author
Forward
0 new messages