Bernd Eckenfels [
https://community.jboss.org/people/b.eckenfels] created the discussion
"InterruptedIO in wildfly main thread"
To view the discussion, visit:
https://community.jboss.org/message/826029#826029
--------------------------------------------------------------
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/j...
https://github.com/wildfly/wildfly/blob/master/server/src/main/java/org/j...
Bernd
PS: The
https://community.jboss.org/docs/DOC-48381 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
[
https://community.jboss.org/message/826029#826029]
Start a new discussion in JBoss AS 7 Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]