How to debug hanging app?

36 views
Skip to first unread message

Fabrice Triboix

unread,
Jan 14, 2020, 6:52:38 PM1/14/20
to modwsgi
Hi everyone,

I tried to find some articles online to help me, but I can't find anything about my specific problem, except for a couple of unanswered questions on SO...

So my Flask-based app runs fine on its own, but when I try to run it in Elastic Beanstalk, it hangs.
I located the line of code which hangs, which is: `from profanity_check import predict_prob`

Because it hangs only when I run it in EB, I need to be enable some kind of debugging at WSGI level. I found many resources about how to deal with crashes and stack traces, but what I need is be able to trace where exactly the app is hanging, as I can't instrument a library such as profanity_check. I was thinking of using the `trace` module to print out every single line of code that is executed, but I don't know how to do that through WSGI....

Any help would be greatly appreciated!

  Fabrice

Graham Dumpleton

unread,
Jan 14, 2020, 6:55:11 PM1/14/20
to mod...@googlegroups.com
An app that hangs is most often because a third party Python package is used which has a C extension which hasn’t been implemented properly so it works with sub interpreters. You need to ensure your application runs in the main Python sub interpreter. See:


If you don’t have direct access to change the Apache config with EB, you will need to work out what the equivalent is for setting:

    WSGIApplicationGroup %{GLOBAL}

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/86e19829-e128-45ed-9212-0da51e61ba17%40googlegroups.com.

Fabrice Triboix

unread,
Jan 22, 2020, 6:20:48 AM1/22/20
to modwsgi
Hi Graham,

Thanks a lot for your input. Apologies for the late response. We decided to remove the offending import and the code depending on it for now.

When we put it back, and if the problem still occurs, I will try to suggestion.

Thanks a lot!

  Fabrice
Graham

To unsubscribe from this group and stop receiving emails from it, send an email to mod...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages