Attempt to lower the number of resources consumed while running tests

I keep having too many resource issues while running tests, so bit the bullet and try to cleanup a lot. We no longer consume 2k+ threads, but there is still a lot more work to do.

After this PR, we peak around 240 threads (used to be 2-3k)
Transport can, which would mean the heart beat thread doesn't get cleaned
up.
On Oct 18, 2014 4:20 PM, "Haoyuan Li" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/master/MasterClient.java:
>
> > @@ -116,11 +116,14 @@ public synchronized void close() {
> >        LOG.debug("Disconnecting from the master {}", mMasterAddress);
> >        mConnected = false;
> >      }
> > -    if (mProtocol != null) {
> > -      mProtocol.getTransport().close();
> > -    }
> > -    if (mHeartbeatThread != null) {
> > -      mHeartbeatThread.shutdown();
> > +    try {
> > +      if (mProtocol != null) {
> > +        mProtocol.getTransport().close();
>
> Did this raise exceptions before?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/474/files#r19056835>.
>