Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-18855

Improve audit log handling code

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Low
    • Resolution: Fixed
    • 6.2.3
    • 7.1.0
    • Audit Logging
    • None

    Description

      Summary

      The audit log events are processed by a thread that can silently fail and stop running.

      Steps to Reproduce

      Using PostgreSQL to easily introduce a failure writing to the audit table

      1. Revoke privileges for the Bamboo database user on the audit table:
        REVOKE ALL PRIVILEGES ON TABLE AUDIT_LOG FROM bamboo;
        
      2. Make a change to a plan that will be audited such as overriding concurrent max builds: Plan Configuration >> Miscellaneous
      3. There will be an exception writing to AUDIT_LOG table
      4. The audit log thread will die and nothing further will log even after restoring permission:
        ALTER TABLE AUDIT_LOG OWNER TO bamboo;
        GRANT ALL PRIVILEGES ON TABLE AUDIT_LOG TO bamboo;
        

      Expected Results

      Audit log thread is robust and continues even after encountering an exception.

      Actual Results

      AuditLogSaveThread is no longer running. Example of the idle thread:

      "AuditLogSaveThread" #37 daemon prio=5 os_prio=0 tid=0x00007fc79bb90000 nid=0x1231 waiting on condition [0x00007fc78dffa000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x00000000c6702bb8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
      	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
      	at com.atlassian.bamboo.persister.DefaultAuditLogService$LoggerThread.run(DefaultAuditLogService.java:125)
      

      Workaround

      Restart Bamboo

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              abacs Andrei
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: