JBIDE-18247 - better organized with better cancelation logic

This is a cleaned up version of the patch with better cancelation logic. Also, see inline notes
doesn't 0 mean infinity thus it should be set since default is not necessarily infinity ? thus >=0 is right ?