There is a possible race condition between the request to dump profile data to a file and the processing of that file. Signal handling should pre-empt process execution; however, it would be useful to confirm this. Browsing the Oracle documentation it is not immediately clear if this is the case:
https://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/signals.html
If there does exist a race condition between dumping and processing we effectively need to count how many dumps to exist and block processing (with a timeout) until all dumps are available. As the code currently works this would require polling the profile data file. Alternatively, we could investigate using tcp profile data capture and a barrier (no polling required).