In case the hard disk itself is taking too long to respond, some operations (especially when RAIDs are involved) will fail and can cause the controller (software or hardware) to drop the disk out of the RAID.
Even when no RAID is used, the hard disk itself can still spend too much time retrying a (failing) read, causing unwanted delays and possible further damage.
To alleviate this, you can try to use a feature called TLER (Time Limited Error Recovery) or CCTL (Command Completion Time Limit). Not all disks support this feature, but when available it can be used to limit the time the disk itself spends on a particular operation before it considers it failed and moves on to the next. This can come very handy when ddrescue is used on a damaged disk with plenty of read issues.
The smartctl program (included with the the smartmontools package on most distros) has built-in support for managing TLER.
To check the current setting (“disabled” means waiting on an operation for an unlimited time):
# smartctl -l scterc /dev/sdX
To set the parameter to a fixed value (7.0 seconds, for example; use 0 to disable TLER):
# smartctl -l scterc,70,70 /dev/sdX
When the disk does not support TLER, smartctl will return an error message:
SCT Error Recovery Control command not supported