Closed dukeimg closed 8 years ago
I have the same code base running either on nginx and apache. With @dukeimg commit it works perfectly on nginx. No more crashes (I was also struggling with this bug)
However, on the apache2 codebase, it doesn't work at all. Probably some config issue.
@dukeimg , were you using nginx on deployment too? Thanks for the commit!!
@dudanogueira Yes. We do use nginx.
Hey Viktor, thanks for a patch! I've just proposed the pylokit's author to incorporate your change in his/her library, let's see if that works out. Here's the ref: https://github.com/xrmx/pylokit/issues/7
@dukeimg @dudanogueira which version of libreoffice do you have? Do you have any backtrace or log?
hi @xrmx I am actually using libreoffice 1:5.2.0~rc4-0ubuntu1~trusty1 and it's working fine with @dukeimg patch with nginx. The strange thing is that it doesn't give much a clue about the problem on the logs. On nginx I got:
2016/08/10 08:09:42 [error] 1623#0: *7 upstream prematurely closed connection while reading response header from upstream, Client. XXXXXXXXX
that's why @dukeimg was bright on his assertion about the origin of the bug. It was like a head shot in the dark :)
@dudanogueira ngnix logs won't tell you much, you'd better check out uwsgi/gunicorn/runner-you-use logs.
@dudanogueira unfoutunately, logs won't tell you anything. That's why I spend 2 hours with debugger, looking how those libraries were executed line by line :P
Hope that's fixed in b0a6669. Feel free to reopen if you see it's not.
Description
I faced a critical bug which kills Django server with exit codes 139, 77.
I have an API which handles .docx render. I will show one of views, as an example, they are pretty similar:
When I call it the first time, it creates a .docx file, saves it to my default_storage and then returns me a download link. But when I try to do it again, or do it with another method (which works with another template and context), my server just crashes without any logs. The last thing I see is either
Process finished with exit code 77 if I call it with a little delay (more then one second) Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) if call my method for the second time right away (in less than one second) I tried to use debuger -- it said that my server crashes on this line:
doc = fill_template('crm/docs/book.ott', context, output_format='docx')
I bet what happens is:
According to this documentation, the process that used
pylockt
should be killed after. But we cannot kill Django server.What I Did
I made some changes to
__init__.py
to add multiprocessing. Pull request is attached.