2

I have a Django instance running in a terminal window. Any time I resize the window, the Django process dies ungracefully, leaving no record of it in the error_log file.

I tested it within ratpoison, xmonad and mwm. Both xterm and rxvt-unicode are affected. Hell, even PuTTY is affected!

dmvianna
  • 397
  • 3
  • 14
  • 3
    Never experienced that myself. Does it happen in single-threaded mode (use `--nothreading`, while starting `python manage.py runserver`)? Cause python has bugs with multithreading not handling signals, e.g. SIGINT as KeyboardInterrupt exception appropriately: http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool. May be there's a similar bug with SIGWINCH, sent upon terminal resize? – Boris Burkov Dec 11 '14 at 00:41
  • Yes it does. I was using `runmodwsgi` before, but using `runserver` with `--nothreading` I get `OSError: [Errno 4] Interrupted system call`. Thanks for your comment, now I know it is a Python issue. :7) – dmvianna Dec 11 '14 at 02:01
  • It could be helpful, if you provided information about your kernel version (is it preemptive?), python version and django version. It also might be related to your terminal, cause reads/writes to terminal are blocking and if they last too long for some reason, the signals coming in the meantime of terminal i/o system call can be discarded with this error as described here: http://www.win.tue.nl/~aeb/linux/lk/lk-4.html – Boris Burkov Dec 11 '14 at 10:13
  • @Bob: Python 2.7, Django 1.7, kernel 2. (off the top of my head) 6. I'm not going to provide exact versions. I tested both remote and local terminals, as you can read in the OP, so I am disinclined to believe they are the problem. – dmvianna Dec 11 '14 at 11:00

1 Answers1

1

Django 1.7 was released September 2, 2014, end of life in December 1, 2015.

However, the problem is still topical.

This was a known issue with Python, documented in

Although Python (and Django) took no special action for SIGWINCH, it was still possible reads to be interrupted. The fix in Python was committed for release 3.5 in Issue23285 , February 07, 2015.

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268