Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
More NPE love
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Antonio Salazar Cardozo  
View profile  
 More options Jun 7 2012, 10:52 am
From: Antonio Salazar Cardozo <savedfastc...@gmail.com>
Date: Thu, 7 Jun 2012 07:52:06 -0700 (PDT)
Local: Thurs, Jun 7 2012 10:52 am
Subject: More NPE love

Hey folks,
In my eternal quest against comet-related NullPointerExceptions, I did
another deep dive of the comet code with some help from a handy jdb stack
trace for one of the aforementioned NPEs. My discovery might help some
things. First, a quick summary of some new discoveries on our part:

When the server starts hitting NPEs (we've previously found that these
happen when the server is overloaded enough with requests that it starts
hitting requests that have been expired by the container, and therefore are
no longer valid), we noticed that we were a bit hosed if we tried to reload
the page, but if we cleared our cookies things worked significantly better.
This pointed to an issue with the session.

After investigating the code, I think what's happening is that a given Lift
session is actually poisoned by one of these invalid requests: the request
breaks the session's makeCometBreakoutDecision (by throwing an NPE when we
try to access the request's underlying server name), which in turn breaks
LiftRules._getLiftSession (see
https://github.com/lift/framework/blob/master/web/webkit/src/main/sca...
), which, finally, breaks any stateful request (see
https://github.com/lift/framework/blob/master/web/webkit/src/main/sca...
). Because this happens in what is essentially the process that decides
which comet requests to go ahead and drop, we get into a situation where
the broken request is never removed, therefore the LiftSession is
“poisoned”: it is unable to process requests, and unable to get out of the
state where it cannot process requests.

I'll be the first to admit that my familiarity with the comet code isn't
100%, so I'm going to propose a solution and see if anyone thinks it's a
catastrophic idea before trying it; first, some details:

 - In LiftRules.makeCometBreakoutDecision, we call session.cometForHost.
This is where things start throwing exceptions (see
https://github.com/lift/framework/blob/master/web/webkit/src/main/sca...
).
 - This is currently only used in makeCometBreakoutDecision, so its sole
purpose is basically to determine which requests to inspect to see if they
need to be dropped (this mechanism exists so that we don't try to keep
alive more requests than a given browser can support for a given host, by
the way).
 - That list is then inspected and the oldest N comet requests are dropped,
where N is the difference between open requests and allowed requests for
the given browser.

I propose we change session.cometForHost to return a tuple or case class.
This will represent (a) available, valid comets and (b) comets with dead
requests that need to be dropped immediately. makeCometBreakoutDecision
will then ask the appropriate ContinuationActors to BreakOut() (a) if
they've been deemed invalid and then (b) if there are too many requests
still open after that. We would deem a comet invalid if r.hostAndPath
throws an exception of any sort.

The purpose here isn't to completely cure the NPE issue, but to make sure
it does not poison the LiftSession, so that further requests can still
work. This should also make NPEs recoverable to some extent, in that I
believe as long as your CometActor's lifeSpan isn't too low, a subsequent
request should be able to catch and properly lead to the appropriate
CometActor.

Let me know if there's anything I can clarify, or if anything here seems
like it would break things terribly.
Thanks,
Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Jun 7 2012, 1:52 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 7 Jun 2012 10:52:53 -0700
Local: Thurs, Jun 7 2012 1:52 pm
Subject: Re: [Lift] More NPE love

+1

Thank you very, very much for chasing this issue down.

We haven't built M1, so go ahead and push it to master as soon as you want.

On Thu, Jun 7, 2012 at 7:52 AM, Antonio Salazar Cardozo <

--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Robinett  
View profile  
 More options Jun 7 2012, 2:40 pm
From: Peter Robinett <pe...@bubblefoundry.com>
Date: Thu, 7 Jun 2012 11:40:51 -0700 (PDT)
Local: Thurs, Jun 7 2012 2:40 pm
Subject: Re: More NPE love

This is epic work and deserving of a Happy Lift'r or three!

Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Jun 7 2012, 2:42 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 7 Jun 2012 11:42:16 -0700
Local: Thurs, Jun 7 2012 2:42 pm
Subject: Re: [Lift] Re: More NPE love

On Thu, Jun 7, 2012 at 11:40 AM, Peter Robinett <pe...@bubblefoundry.com>wrote:

> This is epic work and deserving of a Happy Lift'r or three!

+3

--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jack Park  
View profile  
 More options Jun 7 2012, 2:54 pm
From: Jack Park <jackp...@gmail.com>
Date: Thu, 7 Jun 2012 11:54:23 -0700
Local: Thurs, Jun 7 2012 2:54 pm
Subject: Re: [Lift] Re: More NPE love
Indeed!

On Thu, Jun 7, 2012 at 11:42 AM, David Pollak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antonio Salazar Cardozo  
View profile  
 More options Jun 7 2012, 4:20 pm
From: Antonio Salazar Cardozo <savedfastc...@gmail.com>
Date: Thu, 7 Jun 2012 13:20:15 -0700 (PDT)
Local: Thurs, Jun 7 2012 4:20 pm
Subject: Re: More NPE love

Haha I appreciate it, but let's not get ahead of ourselves. First things
first: getting it up, running, and pushed ;) Then checking if it actually
fixes the issue :p
Thanks,
Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antonio Salazar Cardozo  
View profile  
 More options Jun 7 2012, 6:38 pm
From: Antonio Salazar Cardozo <savedfastc...@gmail.com>
Date: Thu, 7 Jun 2012 15:38:29 -0700 (PDT)
Local: Thurs, Jun 7 2012 6:38 pm
Subject: Re: [Lift] More NPE love

I've tested this locally and pushed the result to master. It doesn't seem
to have broken existing comet code, but I have no confirmation that it
fixes the issues I think it fixes. We can get this on our production
servers either tomorrow or Monday (depending on a couple of other things)
once Jenkins has spun a new version of 2.5-SNAPSHOT, if you'd prefer to
have it battle-tested in at least one place before spinning M1.
Thanks,
Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diego Medina  
View profile  
 More options Jun 7 2012, 8:03 pm
From: Diego Medina <di...@fmpwizard.com>
Date: Thu, 7 Jun 2012 20:03:40 -0400
Local: Thurs, Jun 7 2012 8:03 pm
Subject: Re: [Lift] More NPE love
Thanks for all the work Antonio!

On Thu, Jun 7, 2012 at 6:38 PM, Antonio Salazar Cardozo

--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Jun 7 2012, 8:36 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 7 Jun 2012 17:36:31 -0700
Local: Thurs, Jun 7 2012 8:36 pm
Subject: Re: [Lift] More NPE love

On Thu, Jun 7, 2012 at 5:03 PM, Diego Medina <di...@fmpwizard.com> wrote:
> Thanks for all the work Antonio!

+1

--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mads Hartmann Jensen  
View profile  
 More options Jun 8 2012, 2:50 am
From: Mads Hartmann Jensen <mads...@gmail.com>
Date: Fri, 8 Jun 2012 08:50:50 +0200
Local: Fri, Jun 8 2012 2:50 am
Subject: Re: [Lift] More NPE love

Guys, I'm not scanning all of the emails, please vote on the
Happy Lift'r thread ;)

Cheers,
Mads

On Jun 7, 2012, at 8:40 PM, Peter Robinett wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antonio Salazar Cardozo  
View profile  
 More options Jun 11 2012, 3:57 pm
From: Antonio Salazar Cardozo <savedfastc...@gmail.com>
Date: Mon, 11 Jun 2012 12:57:09 -0700 (PDT)
Local: Mon, Jun 11 2012 3:57 pm
Subject: Re: [Lift] More NPE love

We've been running this for ~16 hours or so on our production server,
everything seems to be running smoothly. Haven't seen any NPEs either, but
that often takes a couple of days after a restart to manifest. The
important thing I was looking for is that nothing seems to have broken :)
Thanks,
Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antonio Salazar Cardozo  
View profile  
 More options Jun 12 2012, 2:35 pm
From: Antonio Salazar Cardozo <savedfastc...@gmail.com>
Date: Tue, 12 Jun 2012 11:35:46 -0700 (PDT)
Local: Tues, Jun 12 2012 2:35 pm
Subject: Re: [Lift] More NPE love

Last round: this morning during a rather hairy deploy, we saw the kind of
load that generally stuffs us full of these NPEs, and not a one was to be
seen. Not foolproof evidence, but as far as we can tell, this problem has
been put to bed! :) We'll report back if we discover otherwise.
Thanks,
Antonio


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diego Medina  
View profile  
 More options Jun 12 2012, 3:15 pm
From: Diego Medina <di...@fmpwizard.com>
Date: Tue, 12 Jun 2012 15:15:23 -0400
Local: Tues, Jun 12 2012 3:15 pm
Subject: Re: [Lift] More NPE love
Great news!

On Tue, Jun 12, 2012 at 2:35 PM, Antonio Salazar Cardozo

--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Jun 12 2012, 3:56 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Tue, 12 Jun 2012 12:56:33 -0700
Local: Tues, Jun 12 2012 3:56 pm
Subject: Re: [Lift] More NPE love

On Tue, Jun 12, 2012 at 11:35 AM, Antonio Salazar Cardozo <

savedfastc...@gmail.com> wrote:
> Last round: this morning during a rather hairy deploy, we saw the kind of
> load that generally stuffs us full of these NPEs, and not a one was to be
> seen. Not foolproof evidence, but as far as we can tell, this problem has
> been put to bed! :) We'll report back if we discover otherwise.

Excellent!!!

--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »