Uploaded image for project: 'Chukwa'
  1. Chukwa
  2. CHUKWA-124

Metrics Data Loader doesn't close connection when data loading is finished.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.1.2
    • Fix Version/s: 0.1.2
    • Component/s: Data Processors
    • Labels:
      None
    • Environment:

      Redhat EL 5.1, Java 6

      Description

      PostProcessManager is running as a deamon now, and jdbc connection without closing becomes a serious issue. Database loader needs to close the connection when sequence file is finished loading to the database.

      1. CHUKWA-124.patch
        4 kB
        Eric Yang
      2. CHUKWA-124-1.patch
        7 kB
        Eric Yang

        Activity

        Hide
        eyang Eric Yang added a comment -

        Close database connection at end of the process.

        Show
        eyang Eric Yang added a comment - Close database connection at end of the process.
        Hide
        eyang Eric Yang added a comment -

        Initialize JDBC on demand

        Show
        eyang Eric Yang added a comment - Initialize JDBC on demand
        Hide
        eyang Eric Yang added a comment -

        Changed JDBC connection to create on demand and close connection when database loading is completed.

        Show
        eyang Eric Yang added a comment - Changed JDBC connection to create on demand and close connection when database loading is completed.
        Hide
        zhangyongjiang Cheng added a comment -

        The commit statement is in the finally block. Shall it be in the try block? If we leave it in the finally block, we should catch the exception. Otherwise if something is wrong with the commit, the close statements will never get called.

        Show
        zhangyongjiang Cheng added a comment - The commit statement is in the finally block. Shall it be in the try block? If we leave it in the finally block, we should catch the exception. Otherwise if something is wrong with the commit, the close statements will never get called.
        Hide
        eyang Eric Yang added a comment -

        Added try and catch around commit.

        Show
        eyang Eric Yang added a comment - Added try and catch around commit.
        Hide
        zhangyongjiang Cheng added a comment -

        +1

        Show
        zhangyongjiang Cheng added a comment - +1
        Hide
        eyang Eric Yang added a comment -

        I just committed this. Thanks Cheng.

        Show
        eyang Eric Yang added a comment - I just committed this. Thanks Cheng.

          People

          • Assignee:
            eyang Eric Yang
            Reporter:
            eyang Eric Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development