[jboss-jira] [JBoss JIRA] (LOGMGR-137) Stack trace enhancement: repeated frames

David Lloyd (JIRA) issues at jboss.org
Tue Jun 7 11:00:02 EDT 2016


David Lloyd created LOGMGR-137:
----------------------------------

             Summary: Stack trace enhancement: repeated frames
                 Key: LOGMGR-137
                 URL: https://issues.jboss.org/browse/LOGMGR-137
             Project: JBoss Log Manager
          Issue Type: Feature Request
            Reporter: David Lloyd
            Priority: Minor


During stack trace rendering, it would be nice (especially for stack overflows) if repeats could be abbreviated, especially when the exception formatter is limited to a certain number of frames.  Take the example from WFLY-6678:

{code}
        ...etc...
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
        ...etc...
{code}

It would be nice to have something like this appear instead:

{code}
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
        (2 frames repeated 49821 more times)
	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
	at com.inovelan.cloud.common.proxy.ProxyInterceptor.handleInvocationResult(ProxyInterceptor.java:37)
{code}

The wording is up for discussion but the idea is that we can save a lot of log space by compacting identical frames.  Because of the complexity in searching repeated frames, we probably should have constraints, like one or more of the following ideas:
* Only compact frames if there is a net savings in the number of lines printed
* Only compact frames if there is a minimum of 4 repeats (one for the top, one for the bottom, and at least two for the middle)
* Only look back a maximum of _n_ frames
* Only look back _n_ frames where _n_ depends on the total stack size (the idea being that the bigger the stack, the more worthwhile the investment in trying to shrink it) - the factor might have to be something weird like a square root to make sense though
* (insert other ideas here)

Determining a repeat in an efficient manner is tricky, because you have to search back up to _n_ frames, meaning you have to check first if 1 frame is a repeat, then 2 frames, then 3 frames, etc.  Furthermore there might be lesser and greater coincident repeats which have to be dealt with sensibly.  Good luck! :-)



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list