[xwiki-devs] [PROPOSAL] Name threads from request URL
Hi devs, When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc... Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL. Basically it means something like adding: Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString()); in XWikiAction#initializeXWikiContext. I tested it on tomcat and it works well. WDYT ? Here is my +1 for this -- Thomas Mortagne
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
I tested it on tomcat and it works well.
WDYT ?
+1 +1 +1. We should also reset the name once the request finishes, so that we don't get false names. We should do the same for non-struts requests also (I can think of REST and WebDAV now). -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Sun, Aug 2, 2009 at 10:34, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
I tested it on tomcat and it works well.
WDYT ?
+1 +1 +1.
We should also reset the name once the request finishes, so that we don't get false names.
We should do the same for non-struts requests also (I can think of REST and WebDAV now).
Yes we should always do this but my first concern was about script so it's more around struts request (and i wanted something simple and clear to vote ;)).
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Thomas Mortagne wrote:
On Sun, Aug 2, 2009 at 10:34, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
Actually this would be better done in a ServletRequestListener, since it doesn't change our code, is modular, and can be easily enabled or disabled through configuration. And this way, all requests will be handled, not just struts ones.
I tested it on tomcat and it works well.
WDYT ? +1 +1 +1.
We should also reset the name once the request finishes, so that we don't get false names.
We should do the same for non-struts requests also (I can think of REST and WebDAV now).
Yes we should always do this but my first concern was about script so it's more around struts request (and i wanted something simple and clear to vote ;)).
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Sun, Aug 2, 2009 at 11:41, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
On Sun, Aug 2, 2009 at 10:34, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
Actually this would be better done in a ServletRequestListener, since it doesn't change our code, is modular, and can be easily enabled or disabled through configuration. And this way, all requests will be handled, not just struts ones.
Yes sounds good. +1 for ServletRequestListener based
I tested it on tomcat and it works well.
WDYT ? +1 +1 +1.
We should also reset the name once the request finishes, so that we don't get false names.
We should do the same for non-struts requests also (I can think of REST and WebDAV now).
Yes we should always do this but my first concern was about script so it's more around struts request (and i wanted something simple and clear to vote ;)).
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Wed, Aug 5, 2009 at 1:08 PM, Thomas Mortagne<[email protected]> wrote:
On Sun, Aug 2, 2009 at 11:41, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
On Sun, Aug 2, 2009 at 10:34, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
Actually this would be better done in a ServletRequestListener, since it doesn't change our code, is modular, and can be easily enabled or disabled through configuration. And this way, all requests will be handled, not just struts ones.
Yes sounds good. +1 for ServletRequestListener based
+1
On Wed, Aug 5, 2009 at 4:40 PM, Jean-Vincent Drean <[email protected]>wrote:
On Wed, Aug 5, 2009 at 1:08 PM, Thomas Mortagne<[email protected]> wrote:
On Sun, Aug 2, 2009 at 11:41, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
On Sun, Aug 2, 2009 at 10:34, Sergiu Dumitriu<[email protected]> wrote:
Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
Actually this would be better done in a ServletRequestListener, since it doesn't change our code, is modular, and can be easily enabled or disabled through configuration. And this way, all requests will be handled, not just struts ones.
Yes sounds good. +1 for ServletRequestListener based
+1
+1 Thanks. - Asiri
+1 Thanks, Marius Thomas Mortagne wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
I tested it on tomcat and it works well.
WDYT ?
Here is my +1 for this
Five +1 and no other votes, committing now On Sat, Aug 1, 2009 at 23:09, Thomas Mortagne<[email protected]> wrote:
Hi devs,
When we have farm like xwiki.org or myxwiki.org stuck we usually kill the jvm and look at its last state to see if we can find some lock etc...
Most of the time if the issue is in a specific script and not a platform bug it's unreadable. To make it more easy I propose to rename thread created by the application server based on the URL.
Basically it means something like adding:
Thread.currentThread().setName(request.getRequestURL() + "?" + request.getQueryString());
in XWikiAction#initializeXWikiContext.
I tested it on tomcat and it works well.
WDYT ?
Here is my +1 for this
-- Thomas Mortagne
-- Thomas Mortagne
participants (5)
-
Asiri Rathnayake -
Jean-Vincent Drean -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne