title: Are fail-fast and fail-safe exception handling principles incompatible?
body: <p>I'd like to understand better what is fail-fast and fail-safe.</p>
  
  <p>What it seems to me at first glance is that fail-fast means that we want to make the system clearly fail when any unexpected thing happens. 
  I mean for exemple if a factory can't create an instance of object, for fail-fast principle, we really don't want the factory to return null, or empty object, or partially initialized object that could, by chance, be used correctly by the application -> most time we would have an unexpected behaviour, or an unexpected exception raised at another level that wouldn't permit us to know the real matter is in the factory.
  It is what this principle means?</p>
  
  <p>Fail safe principle is quite hard to understand for me.
  The most common exemple in Java is about the collections, their iterators and the concurrent access.
  It's said that a collection/iterator that permits modifying a list while iterating over it is called fail-safe. It's usually done by finally iterating over a copy of the initial list.
  But in this exemple i don't really understand where the system fails... and thus while it's fail-safe... Where is the failure? We just iterate over a copy or not, depending on our needs...
  I don't see any match with the wiki definition of fail-safe...</p>
  
  <p>Thus in such articles like:
  <a href="http://www.certpal.com/blogs/2009/09/iterators-fail-fast-vs-fail-safe/" rel="noreferrer">http://www.certpal.com/blogs/2009/09/iterators-fail-fast-vs-fail-safe/</a> 
  They opposite fail-fast to fail-safe... what i just don't catch is why we call fail-safe this iteration over a copy...</p>
  
  <p>I found another exemple here:
  <a href="http://tutorials.jenkov.com/java-exception-handling/fail-safe-exception-handling.html" rel="noreferrer">http://tutorials.jenkov.com/java-exception-handling/fail-safe-exception-handling.html</a>
  It seems a lot more related to initial definition of the fail-safe principle.
  What i think of fail-safe is that when a system fails, we must ensure that the failure handler doesn't fail or, if it does, ensure that the real initial problem is not hidden by the failure of the handler. In the given exemple the handler is right near the initial failure code, but it's not always the case. Fail-safe means to me more something like we handle correctly the errors that could happen in the failure handlers or something like that...</p>
  
  <p>Thus for me these 2 principles doesn't seem incompatible.
  What do you think?
  Can't a system fail fast &amp; safely???</p>