Currently we use std/out/in streams with shared memory that master process communicates over forked jvms in Surefire project. We in some Jira issues talked about it and it seems we came to a decision that we may use another non-socket communication, this means File I/O.
Can we now create a s/w concept for such communication? Last time I started the surefire forked JVM like this <argLine>-verbose:gc</argLine> and the forked JVM corrupted our format and directly wrote native message in std/out stream. Currently the charset ISO-8859-1 is formatted to other binary range including escaping characters and finally the line is finished by '\n'. Can we utilize the same stream format while using File I/O ? My idea is to use separate stream for each JVM in target/.surefire/ folder. This means we will have a plenty of files in there which substitute std/out streams. The file names could be in this format: std-out-<unique-hash-for-jvm>.bin This means there would not be any contention problem to access particular stream. Each JVM should have just own stream and the in-plugin process will read each next unread line similar to reading after System.out.println(). After the line is completely read the String object can be consumed as it is done now without any change. This means incomplete line of the log is stored in memory until it is consumed. The in-plugin process will be responsible for deleting the file but the forked JVM is responsible for flushing each line and closing the stream. We may have several or plenty of I/O handles open in OS at a time. We should decide whether std/in should end up in File I/O however it does not make any problem in the tests I have seen. Currently std/in perfectly fits to shutdown operation in surefire. I am sure without it the shutdown functionality would not be guaranteed. Cheers Tibor
