On Friday, June 3, 2016 at 12:48:26 AM UTC+2, Cristiano Coelho wrote:
>
> So just to be sure, is SIGTERM actually propagated to python code so it 
> can gracefully kill all threads, garbage collect and close connections? 
> Would a SIGKILL actually prevent any kind of cleanup leaving a chance for 
> python/django leave some connections opened?
>

Yes, SIGTERM is a signal Python should handle nicely, SIGKILL will just 
nuke the process from earth and prevent any cleanup I think. Note that the 
OS will clean up though (sooner or later). As for the open connections: 
Check on postgres where from they are and then check on that machine to 
which process they belong and maybe use gdb to find out more.
 

> Maybe this is a postgres issue instead that happened for some very odd 
> reason.
>

The only issue I see here on the postgres side would be that you have very 
long timeouts configured.
 

> Finally, would it be possible through any kind of callbacks of the thread 
> local object to fire a connection close before a thread dies? This would 
> certainly help rather than waiting for the connection to get garbage 
> collected. 
>

Killing a thread and garbage collection should happen at the same time 
roughly due to refcounting imo.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9ce40d73-7e0c-4060-b3a9-7704b91c5d48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to