There's a request scheduler that sits in front of Jetty that simply stops
sending it requests, and when we know it's no longer serving requests, we
kill the process.

The takeaway here is to design for statelessness when possible, and treat
local memory as an extremely volatile resource. Your application can be torn
down and brought back up at any time, and you have no control over which
instance of your application a request or user is routed to - there's no
concept of session affinity per user.

On Sat, Jul 3, 2010 at 12:30 AM, Luis <[email protected]> wrote:

> Ok, then my last question. How do you terminate a thread "gracefully"?
> In standard Java, there is no way to do that (or at least there is not
> any I'm aware of).
>
> In GAE you trigger the "DeadlineExceededException", which reminds me a
> bit of the standard "ThreadDeath" exception (triggered by the
> Thread.stop() method). However there is a difference: the ThreadDeath
> exception can be caught and ignored by the thread, while if the
> DeadlineExceededException is caught then the thread has only one
> second before being definitely stopped (no matter what). How do you do
> that? I.e. what happens when that extra-second is over? Are you using
> a custom-JVM to handle that?
>
> Also, using Thread.stop() is deprecated as some objects could be left
> in an non-consistent state if they need to synchronize access to its
> methods (monitors of synchronized methods hold by the stopped thread
> are just released). Does the DeadlineExceededException have the same
> implications? I.e. are monitors just released without further
> consideration?
>
> Best,
> Luis
>
> On Jul 2, 7:31 pm, "Ikai L (Google)" <[email protected]> wrote:
> > No, the situation is handled gracefully.
> >
> >
> >
> > On Thu, Jul 1, 2010 at 12:29 PM, Luis <[email protected]> wrote:
> > > Thanks again!
> >
> > > But then I have a related question: when you terminate some request
> > > that has last too long, you just kill the whole JVM? Cannot that
> > > affect other petitions attended by other servlets (running in
> > > different threads) of the same application running in that JVM?
> >
> > > Best,
> > > Luis
> >
> > > On Jul 1, 8:02 pm, "Ikai L (Google)" <[email protected]> wrote:
> > > > No, applications run inside their own JVM.
> >
> > > > On Thu, Jul 1, 2010 at 7:23 AM, Luis <[email protected]> wrote:
> > > > > Hi,
> >
> > > > > I'm making a survey about security in PaaS platforms, and I have a
> > > > > question about GAE that maybe you can help me with. It is well
> known
> > > > > that GAE uses Jetty as the servlet container. However, I have not
> been
> > > > > able to find any information about whether each Jetty instance
> hosts
> > > > > servlets of one single user or the same Jetty instance can host
> > > > > servlets of different users at the same time.
> >
> > > > > I wonder about that because I think it is an important question in
> > > > > these environments: Java has certain limitations regarding
> isolation
> > > > > (possible reference leaks). If the same Jetty instance runs
> servlets
> > > > > of different users, then a malicious tenant could try to exploit
> those
> > > > > limitations to access to servlets from other users. If, on the
> other
> > > > > hand, each Jetty instance runs servlets only from an unique user,
> then
> > > > > that problem cannot affect GAE.
> >
> > > > > Thank you very much for help!, regards,
> > > > > Luis
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Google App Engine" group.
> > > > > To post to this group, send email to
> [email protected]
> > > .
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<google-appengine%[email protected]>
> <google-appengine%[email protected]<google-appengine%[email protected]>
> >
> > > <google-appengine%[email protected]<google-appengine%[email protected]>
> <google-appengine%[email protected]<google-appengine%[email protected]>
> >
> >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/google-appengine?hl=en.
> >
> > > > --
> > > > Ikai Lan
> > > > Developer Programs Engineer, Google App Engine
> > > > Blog:http://googleappengine.blogspot.com
> > > > Twitter:http://twitter.com/app_engine
> > > > Reddit:http://www.reddit.com/r/appengine
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine" group.
> > > To post to this group, send email to [email protected]
> .
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-appengine%[email protected]>
> <google-appengine%[email protected]<google-appengine%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine?hl=en.
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
> > Blog:http://googleappengine.blogspot.com
> > Twitter:http://twitter.com/app_engine
> > Reddit:http://www.reddit.com/r/appengine
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to