|
List Info
Thread: Duplicate categories kill blojsom after 8 page views
|
|
| Duplicate categories kill blojsom after
8 page views |

|
2007-04-05 11:48:51 |
With a little help I've found the source of this error and
the results
of it.
A stack trace revealed the error was occurring in
DatabaseFetcher::
fetchCategories(). Six blogs contained categories with
identical "name"
attributes in the "category" table. Five of them
happened to have three
copies while one had two copies. (Hence the error:
"query did not
return a unique result: 3") Every time a page on one
of these blogs was
viewed the error was triggered. It also leads to a bigger
problem.
Once this happens eight times, all blogs stop responding.
Each attempt
to view a blog page will increase java's thread count by
one, and this
happens up to 150 times to a max thread count of (in my
case) 173. At
that point blojsom becomes totally unresponsive until it is
restarted,
and during shutdown the message appears:
Apr 2, 2007 8:51:54 PM
org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 150 instance(s) to be deallocated
Apr 2, 2007 8:51:55 PM
org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 150 instance(s) to be deallocated
Apr 2, 2007 8:51:57 PM
org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 150 instance(s) to be deallocated
I was able to reproduce this scenario by throwing an
exception in
another function in DatabaseFetcher. For example, add the
following
code at line 435:
if (true)
{
throw new FetcherException("Test exception.");
}
Then, load a blog and refresh the page eight times. On the
eighth load
blojsom will become totally unresponsive.
This error seems to be possible because in each case a new
Session is
opened but never closed due to an exception being thrown.
As a result,
once this occurs eight times blojsom goes *poof*. I removed
the
duplicate categories from the database, however I am still
experiencing
the same behavior. I'm guessing that something similar is
still
occurring elsewhere and is not finding its way to the error
log. I hope
to fix the problem by moving every instance of
_sessionFactory.openSession() inside a try block and adding
a finally
block containing session.close(). That way if anything ever
throws an
exception the session will always be closed properly.
I suspect that my duplicate categories were created during
the upgrade
process. I can't test if it's possible to create duplicate
categories
in the admin console since we don't let users choose them
and force them
to be unique, but that would be worth checking out.
Whatever is causing this problem prevents blojsom from
staying up for
more than 5-15 minutes at a time. It'll work perfectly fine
for those
first few minutes and the thread count never falters, then
it suddenly
dies. It's been decided that if it's not stable by the end
of the day
we're going to give up, so I'm going to spend this afternoon
trying to
make it work.
Kenny
-----Original Message-----
From: blojsom-users-bounces lists.sourceforge.net
[mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of Horan,
Kenneth M.
Sent: Tuesday, April 03, 2007 1:56 PM
To: blojsom-users lists.sourceforge.net
Subject: Re: [Blojsom-users] One last error
So far I haven't been able to re-create it. I've got the
log scrolling
beside me and I'm able to view pages, login to a blog, view
admin pages,
and it all works fine for me. Someone's triggering them
though and I
don't know how.
Kenny
-----Original Message-----
From: blojsom-users-bounces lists.sourceforge.net
[mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of David
Czarnecki
Sent: Tuesday, April 03, 2007 12:24 PM
To: blojsom-users
Subject: Re: [Blojsom-users] One last error
It'd be helpful to have some more context such as what
you're doing when
the
error occurs. Is it a permalink request? Is it on loading
entries for a
category?
On 4/3/07 12:12 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
> I'm still seeing one more error in my logs which I
haven't been able
to
> track down. Any idea what could be causing this?
>
> Apr 03 16:05:26 ERROR [http-8080-1]
database.DatabaseFetcher -
> org.hibernate.NonUniqueResultException: query did not
return a unique
> result: 3
> Apr 03 16:05:26 ERROR [http-8080-1]
servlet.BlojsomServlet -
> org.blojsom.fetcher.FetcherException:
> org.hibernate.NonUniqueResultException: query did not
return a unique
> result: 3
>
> Kenny
>
>
------------------------------------------------------------
------------
-
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
chance to
share your
> opinions on IT & business topics through brief
surveys-and earn cash
>
http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
V
> _______________________________________________
> Blojsom-users mailing list
> Blojsom-users lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
--
David Czarnecki
http://www.blojsom.com/b
log/ | http://blojsom.sf.net
------------------------------------------------------------
------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share
your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
------------------------------------------------------------
------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share
your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
|
|
| Re: Duplicate categories kill blojsom
after 8 page views |
  United States |
2007-04-05 18:20:08 |
I'll make sure to go through the DB fetcher tonight and do
consistent
opening and closing of the sessions.
On 4/5/07 12:48 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
> With a little help I've found the source of this error
and the results
> of it.
>
> A stack trace revealed the error was occurring in
DatabaseFetcher::
> fetchCategories(). Six blogs contained categories with
identical "name"
> attributes in the "category" table. Five of
them happened to have three
> copies while one had two copies. (Hence the error:
"query did not
> return a unique result: 3") Every time a page on
one of these blogs was
> viewed the error was triggered. It also leads to a
bigger problem.
> Once this happens eight times, all blogs stop
responding. Each attempt
> to view a blog page will increase java's thread count
by one, and this
> happens up to 150 times to a max thread count of (in my
case) 173. At
> that point blojsom becomes totally unresponsive until
it is restarted,
> and during shutdown the message appears:
>
> Apr 2, 2007 8:51:54 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
> Apr 2, 2007 8:51:55 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
> Apr 2, 2007 8:51:57 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
>
> I was able to reproduce this scenario by throwing an
exception in
> another function in DatabaseFetcher. For example, add
the following
> code at line 435:
>
> if (true)
> {
> throw new FetcherException("Test
exception.");
> }
>
> Then, load a blog and refresh the page eight times. On
the eighth load
> blojsom will become totally unresponsive.
>
> This error seems to be possible because in each case a
new Session is
> opened but never closed due to an exception being
thrown. As a result,
> once this occurs eight times blojsom goes *poof*. I
removed the
> duplicate categories from the database, however I am
still experiencing
> the same behavior. I'm guessing that something similar
is still
> occurring elsewhere and is not finding its way to the
error log. I hope
> to fix the problem by moving every instance of
> _sessionFactory.openSession() inside a try block and
adding a finally
> block containing session.close(). That way if anything
ever throws an
> exception the session will always be closed properly.
>
> I suspect that my duplicate categories were created
during the upgrade
> process. I can't test if it's possible to create
duplicate categories
> in the admin console since we don't let users choose
them and force them
> to be unique, but that would be worth checking out.
>
> Whatever is causing this problem prevents blojsom from
staying up for
> more than 5-15 minutes at a time. It'll work perfectly
fine for those
> first few minutes and the thread count never falters,
then it suddenly
> dies. It's been decided that if it's not stable by the
end of the day
> we're going to give up, so I'm going to spend this
afternoon trying to
> make it work.
>
> Kenny
>
>
>
> -----Original Message-----
> From: blojsom-users-bounces lists.sourceforge.net
> [mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of Horan,
> Kenneth M.
> Sent: Tuesday, April 03, 2007 1:56 PM
> To: blojsom-users lists.sourceforge.net
> Subject: Re: [Blojsom-users] One last error
>
> So far I haven't been able to re-create it. I've got
the log scrolling
> beside me and I'm able to view pages, login to a blog,
view admin pages,
> and it all works fine for me. Someone's triggering
them though and I
> don't know how.
>
> Kenny
>
>
> -----Original Message-----
> From: blojsom-users-bounces lists.sourceforge.net
> [mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of David
> Czarnecki
> Sent: Tuesday, April 03, 2007 12:24 PM
> To: blojsom-users
> Subject: Re: [Blojsom-users] One last error
>
> It'd be helpful to have some more context such as what
you're doing when
> the
> error occurs. Is it a permalink request? Is it on
loading entries for a
> category?
>
>
> On 4/3/07 12:12 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
>
>> I'm still seeing one more error in my logs which I
haven't been able
> to
>> track down. Any idea what could be causing this?
>>
>> Apr 03 16:05:26 ERROR [http-8080-1]
database.DatabaseFetcher -
>> org.hibernate.NonUniqueResultException: query did
not return a unique
>> result: 3
>> Apr 03 16:05:26 ERROR [http-8080-1]
servlet.BlojsomServlet -
>> org.blojsom.fetcher.FetcherException:
>> org.hibernate.NonUniqueResultException: query did
not return a unique
>> result: 3
>>
>> Kenny
>>
>>
>
------------------------------------------------------------
------------
> -
>> Take Surveys. Earn Cash. Influence the Future of
IT
>> Join SourceForge.net's Techsay panel and you'll get
the chance to
> share your
>> opinions on IT & business topics through brief
surveys-and earn cash
>>
> http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
> V
>> _______________________________________________
>> Blojsom-users mailing list
>> Blojsom-users lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
--
David Czarnecki
http://www.blojsom.com/b
log/ | http://blojsom.sf.net
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
|
|
| Re: Duplicate categories kill blojsom
after 8 page views |

|
2007-04-05 18:34:04 |
Attached is the code that I'm currently using. I put every
instance of
a session opening into a try block and followed it up with
a
session.close() in a finally block. There are still
exceptions being
thrown regarding socket timeouts, bad transaction, and
others, but for
the past 6 hours java has been running rock solid at 30
threads. My
fingers are crossed it'll last the night.
I've also learned that this error is due to a bug in
velocity 1.4:
"log4j:ERROR Attempted to append to closed appender
named [null]."
Using velocity 1.5 is said to solve the problem.
Kenny
-----Original Message-----
From: blojsom-users-bounces lists.sourceforge.net
[mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of David
Czarnecki
Sent: Thursday, April 05, 2007 7:20 PM
To: blojsom-users
Subject: Re: [Blojsom-users] Duplicate categories kill
blojsom after 8
page views
I'll make sure to go through the DB fetcher tonight and do
consistent
opening and closing of the sessions.
On 4/5/07 12:48 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
> With a little help I've found the source of this error
and the results
> of it.
>
> A stack trace revealed the error was occurring in
DatabaseFetcher::
> fetchCategories(). Six blogs contained categories with
identical
"name"
> attributes in the "category" table. Five of
them happened to have
three
> copies while one had two copies. (Hence the error:
"query did not
> return a unique result: 3") Every time a page on
one of these blogs
was
> viewed the error was triggered. It also leads to a
bigger problem.
> Once this happens eight times, all blogs stop
responding. Each
attempt
> to view a blog page will increase java's thread count
by one, and this
> happens up to 150 times to a max thread count of (in my
case) 173. At
> that point blojsom becomes totally unresponsive until
it is restarted,
> and during shutdown the message appears:
>
> Apr 2, 2007 8:51:54 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
> Apr 2, 2007 8:51:55 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
> Apr 2, 2007 8:51:57 PM
org.apache.catalina.core.StandardWrapper unload
> INFO: Waiting for 150 instance(s) to be deallocated
>
> I was able to reproduce this scenario by throwing an
exception in
> another function in DatabaseFetcher. For example, add
the following
> code at line 435:
>
> if (true)
> {
> throw new FetcherException("Test
exception.");
> }
>
> Then, load a blog and refresh the page eight times. On
the eighth
load
> blojsom will become totally unresponsive.
>
> This error seems to be possible because in each case a
new Session is
> opened but never closed due to an exception being
thrown. As a
result,
> once this occurs eight times blojsom goes *poof*. I
removed the
> duplicate categories from the database, however I am
still
experiencing
> the same behavior. I'm guessing that something similar
is still
> occurring elsewhere and is not finding its way to the
error log. I
hope
> to fix the problem by moving every instance of
> _sessionFactory.openSession() inside a try block and
adding a finally
> block containing session.close(). That way if anything
ever throws an
> exception the session will always be closed properly.
>
> I suspect that my duplicate categories were created
during the upgrade
> process. I can't test if it's possible to create
duplicate categories
> in the admin console since we don't let users choose
them and force
them
> to be unique, but that would be worth checking out.
>
> Whatever is causing this problem prevents blojsom from
staying up for
> more than 5-15 minutes at a time. It'll work perfectly
fine for those
> first few minutes and the thread count never falters,
then it suddenly
> dies. It's been decided that if it's not stable by the
end of the day
> we're going to give up, so I'm going to spend this
afternoon trying to
> make it work.
>
> Kenny
>
>
>
> -----Original Message-----
> From: blojsom-users-bounces lists.sourceforge.net
> [mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of
Horan,
> Kenneth M.
> Sent: Tuesday, April 03, 2007 1:56 PM
> To: blojsom-users lists.sourceforge.net
> Subject: Re: [Blojsom-users] One last error
>
> So far I haven't been able to re-create it. I've got
the log
scrolling
> beside me and I'm able to view pages, login to a blog,
view admin
pages,
> and it all works fine for me. Someone's triggering
them though and I
> don't know how.
>
> Kenny
>
>
> -----Original Message-----
> From: blojsom-users-bounces lists.sourceforge.net
> [mailto:blojsom-users-bounces lists.sourceforge.net] On
Behalf Of
David
> Czarnecki
> Sent: Tuesday, April 03, 2007 12:24 PM
> To: blojsom-users
> Subject: Re: [Blojsom-users] One last error
>
> It'd be helpful to have some more context such as what
you're doing
when
> the
> error occurs. Is it a permalink request? Is it on
loading entries for
a
> category?
>
>
> On 4/3/07 12:12 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
>
>> I'm still seeing one more error in my logs which I
haven't been able
> to
>> track down. Any idea what could be causing this?
>>
>> Apr 03 16:05:26 ERROR [http-8080-1]
database.DatabaseFetcher -
>> org.hibernate.NonUniqueResultException: query did
not return a unique
>> result: 3
>> Apr 03 16:05:26 ERROR [http-8080-1]
servlet.BlojsomServlet -
>> org.blojsom.fetcher.FetcherException:
>> org.hibernate.NonUniqueResultException: query did
not return a unique
>> result: 3
>>
>> Kenny
>>
>>
>
------------------------------------------------------------
------------
> -
>> Take Surveys. Earn Cash. Influence the Future of
IT
>> Join SourceForge.net's Techsay panel and you'll get
the chance to
> share your
>> opinions on IT & business topics through brief
surveys-and earn cash
>>
>
http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
> V
>> _______________________________________________
>> Blojsom-users mailing list
>> Blojsom-users lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
--
David Czarnecki
http://www.blojsom.com/b
log/ | http://blojsom.sf.net
------------------------------------------------------------
------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share
your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.p
hp?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Blojsom-users mailing list
Blojsom-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers
|
|
|
[1-3]
|
|