JBoss Community

InterruptedIO in wildfly main thread

created by Bernd Eckenfels in JBoss AS 7 Development - View the full discussion

Hello,

 

in Domain mode the wildfly server will loop over the inputStream and read the connection coordinates of the master controller. When this loop is ended by a closed input stream the server will terminate.

 

There is a catch in InterruptedIOException, which clears the interrupted state (which should not be needed as throwing that exception will already do). This catch will then continue to loop. I see this a bit problematic as you never know how many objects (and partial objects) have been read. So if you loop on interrupt you might read corrupt information or even worse read partial information and wait endless for its end.

 

We could I guess try to analyse where the exception have been thrown and also look at InterruptedIOException#bytesTransferred, but I think the safest thing to do here would be to actually break aka terminate.

 

One thing which could be considered is to have the protocol beween PC and server a bit more robust. A first step would be to define a well known message length (and possibly version header) and a magic signature. Under those conditions the interrupted read could be more sanely retried.

 

What do you think?

 

https://github.com/wildfly/wildfly/blob/master/server/src/main/java/org/jboss/as/server/DomainServerMain.java#L140

 

Bernd

 

PS: The

Hacking on WildFly

 

wiki page still points to this forum instead of the ML, is this intentional?

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community