GitHub user omerhadari opened a pull request:

    https://github.com/apache/storm/pull/2234

    Bugfix/fix configuration cast exception

    I open this PR since I was delighted to see that there is an existing JMS 
spout implementation, but encountered a bug when trying to use it. The bug 
caused an exception (described below) to be thrown when trying to set up 
(`open`) the spout, since the value of `Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS` 
corresponds to a `Long`, and not to an `Integer`.
    
    This is a minor change, hope it's ok :)
    
    ```
    7317 [Thread-18-a-executor[2 2]] ERROR o.a.s.util - Async loop died!
    java.lang.ClassCastException: java.lang.Long cannot be cast to 
java.lang.Integer
        at org.apache.storm.jms.spout.JmsSpout.open(JmsSpout.java:175) 
~[storm-jms-1.1.0.jar:1.1.0]
        at 
org.apache.storm.daemon.executor$fn__4976$fn__4991.invoke(executor.clj:600) 
~[storm-core-1.1.0.jar:1.1.0]
        at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:482) 
[storm-core-1.1.0.jar:1.1.0]
        at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
    7320 [Thread-18-a-executor[2 2]] ERROR o.a.s.d.executor - 
    java.lang.ClassCastException: java.lang.Long cannot be cast to 
java.lang.Integer
        at org.apache.storm.jms.spout.JmsSpout.open(JmsSpout.java:175) 
~[storm-jms-1.1.0.jar:1.1.0]
        at 
org.apache.storm.daemon.executor$fn__4976$fn__4991.invoke(executor.clj:600) 
~[storm-core-1.1.0.jar:1.1.0]
        at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:482) 
[storm-core-1.1.0.jar:1.1.0]
        at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/omerhadari/storm 
bugfix/fix-configuration-cast-exception

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/2234.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2234
    
----
commit 34d6fdcb5b85c06cb6d365f60e8f6a77006eec75
Author: Omer Hadari <hadari.o...@gmail.com>
Date:   2017-07-21T07:21:23Z

    Cast message timeout conf to `Number`
    
    I changed the casting to `Number` instead of `Integer`
    since it is actually a `Long`, and it caused a `ClassCastException`
    to be thrown. Now it is referred to as a `Number` so that it won't
    happen again.

commit fac2080cb3042e0bc41a0447f47298d3e4e792a1
Author: Omer Hadari <hadari.o...@gmail.com>
Date:   2017-07-21T07:31:54Z

    Test behaviour for different Number types

commit afb8adc157f4a7f2f7338cfffe6f4d175df5db5d
Author: Omer Hadari <hadari.o...@gmail.com>
Date:   2017-07-21T15:06:24Z

    Remove accidental license edit

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to