Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Infinite loop on shutdown

DidierB
2008-12-18
2013-04-24
  • DidierB
    DidierB
    2008-12-18

    Hi,

    I have detected an infinite loop in the shutdown method of thinwire.render.web.Webapplication class.
    It append when the application quits

    Here is the original code

    while (proc.isInUse()) {
      if (log.isLoggable(LEVEL)) log.log(LEVEL, Thread.currentThread().getName() + ": processor returned, probably from flush(), sending null event");
      proc.handleRequest((WebComponentEvent)null, new CharArrayWriter());                   
      }

    I have added a counter to avoid this infinite loop

    int i=0;
    while (proc.isInUse() && i++<1024) {
      if (log.isLoggable(LEVEL)) log.log(LEVEL, Thread.currentThread().getName() + ": processor returned, probably from flush(), sending null event");
      proc.handleRequest((WebComponentEvent)null, new CharArrayWriter());                   
      }

    This currently solve my problem but a deeper analysis is required.

    /Didier