cryostat-legacy icon indicating copy to clipboard operation
cryostat-legacy copied to clipboard

Gracefully handle actions upon 0-length recordings

Open andrewazores opened this issue 3 years ago • 0 comments

Related #715 , which is about preventing these problems from occurring specifically for Snapshot recordings which may be produced with 0-length

If a recording has no event content, ie has 0 length, Cryostat should gracefully handle various errors that may occur when attempting to process this recording for report generation, archiving, or uploading to jfr-datasource.

For archiving an active recording, Cryostat should detect that the remote recording stream has terminated before any bytes were read, and respond to the client with an HTTP status message that indicates that the action failed because there was no data.

For uploading a recording (active or archived) to jfr-datasource, Cryostat should detect that the stream is terminated before any bytes were read (active) or that the source file has 0 length (archived), and again respond to the client with an HTTP status message that indicates that the action failed because there was no data.

For generating a report from a recording (active or archived), Cryostat should again detect the early stream termination or empty file. Rather than an HTTP error response, perhaps it should respond with an HTML document that informs the user that there was no data in the recording, so that this document can be displayed in the web-client's usual report iframe. This would likely also end up as a cached report result, which certainly makes sense for archived recordings but may not make sense for active recordings.

andrewazores avatar Oct 12 '21 19:10 andrewazores