[TACHYON-163]After 5 attempts we exit to avoid infinity retires

https://tachyon.atlassian.net/browse/TACHYON-163

Probably we should exit after attempts
If the connect method leads to infinity loop, user might think TahcyonWorker is fine with seeing the JVM process still existing.
Currently the code only registers like you said, if a heartbeat happens
before registration happens.

On Sun, Oct 12, 2014 at 9:55 AM, WangTao <notifications@github.com> wrote:

> In core/src/main/java/tachyon/worker/WorkerStorage.java:
>
> > @@ -744,8 +744,7 @@ public void register() {
> >          CommonUtils.sleepMs(LOG, Constants.SECOND_MS);
> >        } catch (IOException e) {
> >          LOG.error(e.getMessage(), e);
> > -        id = 0;
> > -        CommonUtils.sleepMs(LOG, Constants.SECOND_MS);
> > +        System.exit(-1);
>
> I see your point. Maybe we'd better not exit here as worker will register
> as master requests.
> But I'm not clear in which scenario master will request worker to
> reregister ( in code it is when master couldn't find value of workerId in
> MasterInfo.mWorkers).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/449/files#r18748588>.
>