We have recently been doing some load testing of our application which uses the smack libraries to connect to an Openfire chat server. We came across some NumberFormatExceptions in:
We did some investigation, and it seems that both classes use a static SimpleDateFormat object, which is not thread safe.
I’ve attached patches for these classes which have fixed the problem. Could you please create a bug report for this?
QueueDetails.diff.zip (1021 Bytes)
QueueOverview.diff.zip (851 Bytes)
That’s great, thanks. I noticed the priority was set to Minor. I would have expected this to have a higher priority - as soon as you put any load on the system, this exception is thrown and the chat session is dropped. This seems like a fairly major problem to me, especially since it will randomly affects sessions.
I put it as minor because it is isolated to the usage of a proprietary OpenFire plugin, not general usage of the library. It was more about the scope of the error to users of Smack at large than it’s actual impact to that particular feature.
Thanks for posting your patches, this appears to have resolved a long-standing problem on our system where our (proprietary) Fastpath agents were getting disconnected several times per day with the NumberFormatException you describe. Only been in production for 24 hours but no occurrences so far…
That’s great Chris, I’m glad the patch helped!