You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Jungtaek Lim (JIRA)" <ji...@apache.org> on 2016/08/30 00:07:20 UTC

[jira] [Commented] (STORM-2067) "array element type mismatch" from compute-executors in nimbus.clj

    [ https://issues.apache.org/jira/browse/STORM-2067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15447500#comment-15447500 ] 

Jungtaek Lim commented on STORM-2067:
-------------------------------------

This is due to Clojure's optimization.
Clojure has two implicit types of persistent map: PersistentArrayMap and PersistentHashMap. Which type Clojure uses for persisting map is determined by specific threshold, so in fact Clojure should make sure that users don't need to care about this.
But this is not true for into-array with no type information. If into-array is called with no type information, into-array uses the class which is type of first element.

Unfortunately, from below line, component->executors and maps were different types which one is PersistentArrayMap and another one is PersistentHashMap.
{code}
(into-array (into [component->executors] maps))
{code}

We should pass common type of two maps. Since parameter type of Utils/joinMaps is Map[], we can pass Map to into-array.

> "array element type mismatch" from compute-executors in nimbus.clj
> ------------------------------------------------------------------
>
>                 Key: STORM-2067
>                 URL: https://issues.apache.org/jira/browse/STORM-2067
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-core
>            Reporter: Jungtaek Lim
>            Assignee: Jungtaek Lim
>
> In some scenarios, Nimbus throws "java.lang.IllegalArgumentException: array element type mismatch".
> {noformat}
> 08:49:35.321 [timer] ERROR o.a.s.d.nimbus - Error when processing event
> java.lang.IllegalArgumentException: array element type mismatch
> 	at java.lang.reflect.Array.set(Native Method) ~[?:1.8.0_66]
> 	at clojure.lang.RT.seqToTypedArray(RT.java:1719) ~[clojure-1.7.0.jar:?]
> 	at clojure.lang.RT.seqToTypedArray(RT.java:1692) ~[clojure-1.7.0.jar:?]
> 	at clojure.core$into_array.invoke(core.clj:3319) ~[clojure-1.7.0.jar:?]
> 	at org.apache.storm.daemon.nimbus$compute_executors$fn__4307.doInvoke(nimbus.clj:645) ~[classes/:?]
> 	at clojure.lang.RestFn.invoke(RestFn.java:408) ~[clojure-1.7.0.jar:?]
> 	at org.apache.storm.daemon.nimbus$compute_executors.invoke(nimbus.clj:645) ~[classes/:?]
> 	at org.apache.storm.daemon.nimbus$compute_executor__GT_component.invoke(nimbus.clj:655) ~[classes/:?]
> 	at org.apache.storm.daemon.nimbus$read_topology_details.invoke(nimbus.clj:565) ~[classes/:?]
> 	at org.apache.storm.daemon.nimbus$mk_assignments$iter__4668__4672$fn__4673.invoke(nimbus.clj:967) ~[classes/:?]
> 	at clojure.lang.LazySeq.sval(LazySeq.java:40) ~[clojure-1.7.0.jar:?]
> 	at clojure.lang.LazySeq.seq(LazySeq.java:49) ~[clojure-1.7.0.jar:?]
> 	at clojure.lang.RT.seq(RT.java:507) ~[clojure-1.7.0.jar:?]
> 	at clojure.core$seq__4128.invoke(core.clj:137) ~[clojure-1.7.0.jar:?]
> 	at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30) ~[clojure-1.7.0.jar:?]
> 	at clojure.core.protocols$fn__6506.invoke(protocols.clj:101) ~[clojure-1.7.0.jar:?]
> 	at clojure.core.protocols$fn__6452$G__6447__6465.invoke(protocols.clj:13) ~[clojure-1.7.0.jar:?]
> 	at clojure.core$reduce.invoke(core.clj:6519) ~[clojure-1.7.0.jar:?]
> 	at clojure.core$into.invoke(core.clj:6600) ~[clojure-1.7.0.jar:?]
> 	at org.apache.storm.daemon.nimbus$mk_assignments.doInvoke(nimbus.clj:966) ~[classes/:?]
> 	at clojure.lang.RestFn.invoke(RestFn.java:410) ~[clojure-1.7.0.jar:?]
> 	at org.apache.storm.daemon.nimbus$fn__5354$exec_fn__579__auto____5355$fn__5366$fn__5367.invoke(nimbus.clj:2409) ~[classes/:?]
> 	at org.apache.storm.daemon.nimbus$fn__5354$exec_fn__579__auto____5355$fn__5366.invoke(nimbus.clj:2408) ~[classes/:?]
> 	at clojure.lang.AFn.run(AFn.java:22) ~[clojure-1.7.0.jar:?]
> 	at org.apache.storm.StormTimer$1.run(StormTimer.java:190) ~[classes/:?]
> 	at org.apache.storm.StormTimer$StormTimerTask.run(StormTimer.java:83) [classes/:?]
> {noformat}
> The exception is thrown from into-array, which is called from below line:
> {code}
> ((fn [ & maps ] (Utils/joinMaps (into-array (into [component->executors] maps)))))
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)