#16682: KeyboardInterrupt not handled properly in transaction aborting
-------------------------------------+-------------------------------------
     Reporter:  Malcolm Tredinnick   |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.3
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  1.11                 |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 I wasn't able to reproduce the hang on Oracle 11g/12c. I will try later
 with Oracle DB Developer VM. Small suggestion is to use `signal.SIGINT`
 instead of signal number.

 {{{#!python
 --- a/tests/transactions/tests.py
 +++ b/tests/transactions/tests.py
 @@ -1,6 +1,7 @@
  from __future__ import unicode_literals

  import os
 +import signal
  import sys
  import threading
  import time
 @@ -225,8 +226,8 @@ class AtomicTests(TransactionTestCase):
              with transaction.atomic():
                  Reporter.objects.create(first_name='Tintin')
                  # Send SIGINT (simulate Ctrl-C). One call isn't enough.
 -                os.kill(os.getpid(), 2)
 -                os.kill(os.getpid(), 2)
 +                os.kill(os.getpid(), signal.SIGINT)
 +                os.kill(os.getpid(), signal.SIGINT)
          except KeyboardInterrupt:
              pass
          self.assertEqual(Reporter.objects.all().count(), 0)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/16682#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.ecababa58618bb8f4099996bdbbff716%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to