Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-28666

Dropping unclosed WALTailingReaders leads to leaked sockets

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      WALEntryStream#prepareReader() will, in some cases, reach the line

      reader = WALFactory.createTailingReader(fs, nextPath, conf, currentPositionOfEntry > 0 ? currentPositionOfEntry : -1);
      

      when reader is non-null. In this case, the old object pointed to by reader becomes un-referenced and is garbage-collected. However, that object was never closed.

      At Hubspot we see the effects of this when doing tests that use inter-cluster replication. Machines in the source cluster experience a build-up of sockets. Eventually this causes the machine to run out of TCP kernel memory and start dropping packets. The only workaround currently is to restart the RegionServer process.

      I have found that simply putting

      closeReader();
      

      immediately before the line quoted above appears to resolve the issue and causes no obvious problems. However, I'm still developing a proper test for this fix.

      Attachments

        Issue Links

          Activity

            People

              charlesconnell Charles Connell
              charlesconnell Charles Connell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: