Qpid
  1. Qpid
  2. QPID-3559

SimpleDateFormat used in thread unsafe manner in JMX interface

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10, 0.11, 0.12, 0.13
    • Fix Version/s: 0.15
    • Component/s: Java Broker
    • Labels:
      None

      Description

      AMQQueueMBean uses a static SimpleDateFormat instance which is thread-unsafe. The user may see corruption of JMS Expiration dates or JMS Timestamps reported via the JMX interface.

      This problem only affects the MBean, JMS messaging clients wont be affected.

        Activity

        Hide
        Keith Wall added a comment -

        Applied patch to resolve issue. Added support unit and system tests.

        Show
        Keith Wall added a comment - Applied patch to resolve issue. Added support unit and system tests.
        Hide
        Keith Wall added a comment -

        Hi Robbie, could you review this change please?

        Show
        Keith Wall added a comment - Hi Robbie, could you review this change please?
        Hide
        Robbie Gemmell added a comment -

        I think it might be preferable to use an instance variable for the SimpleDateFormat object and just synchronize its access, or something else to similar effect, rather than use a new instance per method call. I know its not a big object but it could generate a significant amount of garbage due to being used per-message, and the JMX interface already generates quite a lot

        Show
        Robbie Gemmell added a comment - I think it might be preferable to use an instance variable for the SimpleDateFormat object and just synchronize its access, or something else to similar effect, rather than use a new instance per method call. I know its not a big object but it could generate a significant amount of garbage due to being used per-message, and the JMX interface already generates quite a lot
        Hide
        Keith Wall added a comment -

        Addressed review comments (finally - sorry, slipped my mind).

        Show
        Keith Wall added a comment - Addressed review comments (finally - sorry, slipped my mind).
        Hide
        Robbie Gemmell added a comment -

        Looks good to me.

        Show
        Robbie Gemmell added a comment - Looks good to me.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Keith Wall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development