Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 3.6.1, 3.7
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Jeff Caswell's patch applied:

      We have been having a number of issues with story parameter conversion and number format errors in a multithreaded environment.

      This was tracked back to the java.text.NumberFormat instance held by the ParameterConverters NumberConverter inner class.

      The constructor is only run once when a number of stories are launched and the instance is used by all the stories in the run.

      I suspect there may be other issues affecting this, however by converting the NumberFormat to ThreadLocal storage has solved the problem here.

      The patch is pretty much self explanitory, the only aspect that may not immediately seem obvious is that the NumberFormat passed in on the constructor was itself constructed with the users preferred Locale. It is for this reason that I have treated it as the 'preferred format' and cloned it for the thread local copy. Also I did not issue an explicit remove since tests are run as a relatively short lived batch job and I did not feel that there was any reason to worry about an associated memory leak.

        Activity

        Paul Hammant made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mauro Talevi made changes -
        Summary ParameterConverters not threadsafe NumberConverter not threadsafe
        Affects Version/s 3.6 [ 17721 ]
        Hide
        Mauro Talevi added a comment -

        Minor renames of https://github.com/swa-jcaswell/jbehave-core/commit/0b53a815f2a99a9944d7afc697d402ab50be106b.
        In particular, renamed preferredNumberFormat -> numberFormat and numberFormat -> threadLocalNumberFormat.

        Show
        Mauro Talevi added a comment - Minor renames of https://github.com/swa-jcaswell/jbehave-core/commit/0b53a815f2a99a9944d7afc697d402ab50be106b . In particular, renamed preferredNumberFormat -> numberFormat and numberFormat -> threadLocalNumberFormat.
        Mauro Talevi made changes -
        Fix Version/s 3.7 [ 18390 ]

          People

          • Assignee:
            Paul Hammant
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: