Java 11 cannot stop ffmpeg, java 8 can

Hello,

I installed jibri on debian buster. If I use the default-jre-headless it will install openjdk-11-jre-headless. Apparenty jibri works with it but it cannot stop ffmpeg, hence the recording is corrupted:

2020-04-09 16:28:55.787 SEVERE: [37] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Error trying to gracefully stop ffmpeg, destroying forcibly
2020-04-09 16:28:55.793 INFO: [37] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() ffmpeg exited with value 137

ffmpeg.0.txt just shows that it’s still capturing until it’s killed.

If I use openjdk-8-jre-headless (from the stretch repositories) I can see that ffmpeg stops correctly.

I’m seeing the same thing on Ubuntu 20.04, with the latest version of Jibri.

When manually stopping a recording in a room, the ffmpeg process takes a lot less time to finish up compared to leaving the room completely.

This results in the video file being completely black (not sure if there something else I need to get this fixed), the file size seems to be OK, but is not playable in any video player.

ffmpeg returns exit code 137 due to the kill -9 (128+9).

2020-05-13 13:41:57.779 INFO: [516] org.jitsi.jibri.selenium.JibriSelenium.onSeleniumStateChange() Transitioning from state Running to Finished
2020-05-13 13:41:57.779 INFO: [516] org.jitsi.jibri.service.impl.FileRecordingJibriService.onServiceStateChange() File recording service transitioning from state Running to Finished
2020-05-13 13:41:57.779 INFO: [516] org.jitsi.jibri.api.xmpp.XmppApi.invoke() Current service finished, sending off iq <iq to='jibribrewery@internal.auth.meet.cao.ac.za/focus' id='BryuC-703' type='set'><jibri xmlns='http://jitsi.org/protocol/jibri' status='off'/></iq>
2020-05-13 13:41:57.779 FINE: [516] org.jitsi.jibri.statsd.JibriStatsDClient.incrementCounter() Incrementing statsd counter: stop:recording
2020-05-13 13:41:57.779 INFO: [516] org.jitsi.jibri.JibriManager.stopService() Stopping the current service
2020-05-13 13:41:57.779 INFO: [516] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Stopping capturer
2020-05-13 13:41:57.780 INFO: [516] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Stopping ffmpeg process
2020-05-13 13:42:07.780 SEVERE: [516] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Error trying to gracefully stop ffmpeg, destroying forcibly
2020-05-13 13:42:07.786 INFO: [516] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() ffmpeg exited with value 137