This just won't work on a front end request. Any thread you create will be
destroyed at the end of the request.
The appengine front end is not designed for this type of capabiltiy.
You could consider running your mongo interface on a managed vm, and then
use some sort of simple rpc mechanism to talk to this interface.
Alternately find a light weight connection service that only exists for the
duration of a request.
T
On Thursday, November 5, 2015 at 5:39:20 AM UTC+8, Minie Takalova wrote:
>
> Thank you for your responses.
>
> Re. Jeff Schnitze:
> Nice mind-shift to change behaviour of driver. This way solution doesn't
> occured me. On the other side it is sad. Instead of 5 lines code to
> rebuild driver. I keep this solution as last chance if I find nothing
> easier.
> Maybe it eventually prove, as the simplest solution.
>
> Re. Nick:
> My opinion is, that for connection is open new thread, but GAE frontend
> want to every opened thread stopped before finaly return result.
>
>
> --- The timeout mesage is: ----
>
> Error: Server Error
> The server encountered an error and could not complete your request.
> Please try again in 30 seconds.
>
> --- Line of code where GAE freeze ---
> It freeze on response. Doesn't matter which type of response it is. It can
> be simple response:
> return HttpResponse('Done')
>
> ---Logs from development console ---
> .....
>
> File
> "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/mongo_client.py",
> line 372, in __init__
> executor.open()
> File
> "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/periodic_executor.py",
> line 64, in open
> thread.start()
> File
> "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/threading.py",
> line 505, in start
> _start_new_thread(self.__bootstrap, ())
> File
> "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/runtime.py",
> line 82, in StartNewThread
> return base_start_new_thread(Run, ())
>
>
> --------------
>
> ....
>
> File
> "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/mongo_client.py",
> line 353, in __init__
> self._topology.open()
> File "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/topology.py",
> line 60, in open
> self._ensure_opened()
> File "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/topology.py",
> line 273, in _ensure_opened
> self._update_servers()
> File "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/topology.py",
> line 341, in _update_servers
> server.open()
> File "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/server.py",
> line 35, in open
> self._monitor.open()
> File "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/monitor.py",
> line 74, in open
> self._executor.open()
> File
> "/base/data/home/apps/MyAPP/1.388269338940512065/pymongo/periodic_executor.py",
> line 64, in open
> thread.start()
> File
> "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/threading.py",
> line 505, in start
> _start_new_thread(self.__bootstrap, ())
> File
> "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/runtime.py",
> line 82, in StartNewThread
> return base_start_new_thread(Run, ())
>
> --------------------
>
> Threads started by this request continued executing past the hard deadline.
>
>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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 http://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/8f23bede-c103-48aa-9f45-ee8116d68e8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.