Ticket #1671 (closed: fixed)
SaveSPE: should throw an error if it runs out of disk space
Reported by: | Janik Zikovsky | Owned by: | Keith Brown |
---|---|---|---|
Priority: | major | Milestone: | Release 2.6 |
Component: | Framework | Keywords: | Student,First |
Cc: | Blocked By: | ||
Blocking: | Tester: | Samuel Jackson |
Description
We ran SaveSPE for a while to a mount with no more space available; it created 0-length files rather than throw any useful error message.
Change History
comment:1 Changed 10 years ago by Nick Draper
- Status changed from new to assigned
- Owner set to Steve Williams
- Milestone changed from Iteration 25 to Iteration 26
comment:2 Changed 10 years ago by Nick Draper
- Milestone changed from Iteration 26 to Iteration 27
Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.
comment:3 Changed 10 years ago by Nick Draper
- Milestone changed from Iteration 27 to Iteration 28
Bulk move of tickets at the end of iteration 27
comment:4 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 28 to Iteration 29
Bulk move of tickets at the end of iteration 28
comment:5 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 29 to Iteration 30
Accepted and assigned tickets moved at iteration 29 code freeze
comment:6 Changed 9 years ago by Anders Markvardsen
- Owner changed from Steve Williams to Anders Markvardsen
comment:7 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 30 to Iteration 31
Bulk move of tickets to iteration 31 at the iteration 30 code freeze
comment:9 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 32 to Iteration 33
Moved to iteration 33 at iteration 32 code freeze
comment:10 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.1 to Release 2.2
Moved at end of release 2.1
comment:11 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.2 to Release 2.3
Moved at the end of release 2.2
comment:12 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.3 to Release 2.4
Moved to milestone 2.4
comment:13 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.4 to Release 2.5
Moved at the code freeze for release 2.4
comment:14 Changed 7 years ago by Nick Draper
- Milestone changed from Release 2.5 to Release 2.6
comment:18 Changed 7 years ago by Keith Brown
Moved the bulk of exec to a new function in SaveSPE.
Created new macro to wrap fprintf so it throws an exception when it prints nothing, so that when the write fails i can catch the exception, close the file and delete it with the filename in scope. Refs #1671
Changeset: d5e5e8f0d846ed43d6c9f50cf85f3084b8785e8e
comment:19 Changed 7 years ago by Keith Brown
Added file remove functionality
File is now removed if the function throws as the file wasn't written properly
Refs #1671
Changeset: 2741e79b66e332443f751725781e0123828f3e98
comment:20 Changed 7 years ago by Keith Brown
Fixed documentation and few style errors
Added proper documentation for the macro, and fixed some style problems not caused by me.
Refs #1671
Changeset: 581ed2b356da89f40822bddf3be04a83cc9754a1
comment:22 Changed 7 years ago by Keith Brown
- Status changed from accepted to verify
- Resolution set to fixed
To Test:
There is no unit test for this fix. Instead manually load some SPE data into a workspace and save it using SaveSPE (some applicable data can be found in systemtests/SystemTests/AnalysisTests/ReferenceResults/MARIReduction.nxs)
First save it into a place with enough space and permissions to see how big the file should be normally, then save the file to a disk (such as USB key) with no free space. Nothing should end up saved on the USB key as when the save operation fails the file should be removed. Other tests to consider is saving to a disk with free space but not enough for the file (MARIReduction.nxs saves into a 2MB file) or saving to a place where the program doesn't have permissions.
All example instances (bar saving to somewhere with enough space and permissions) should throw and delete the file if possible if the save failed to complete it it's entirety.
comment:23 Changed 7 years ago by Samuel Jackson
- Status changed from verify to verifying
- Tester set to Samuel Jackson
comment:24 Changed 7 years ago by Samuel Jackson
- Status changed from verifying to reopened
- Resolution fixed deleted
Testing failed on Ubuntu 12.04 LTS. Algorithm still writes to full drives with a blank file. Also, if a file extension isn't explicitly set "All Files(*)" gets appended to the end of the file name instead.
comment:25 Changed 7 years ago by Keith Brown
Debugging had only been done on Windows, wasn't aware it would react differently on other platforms as the platform haddn't been specified on the original report. Now looking to see if i can fix it cross-platform.
comment:26 Changed 7 years ago by Keith Brown
- Status changed from reopened to accepted
Tester has just realised that he'd not compiled the project, reopening for testing
comment:27 Changed 7 years ago by Keith Brown
- Status changed from accepted to verify
- Resolution set to fixed
comment:29 Changed 7 years ago by Samuel Jackson
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/bugfix/1671_disk_full_throw'
comment:31 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 2518