Projects tigase _server server-core Issues #956
ClusterRepoItemEvent causes exceptions (#956)
Andrzej Wójcik (Tigase) opened 6 years ago

Following exception is being thrown when one of the cluster nodes fires ClusterRepoItemEvent:

2018-06-17 13:42:26.768 [in_0-eventbus]    StanzaProcessor.processPacket()         SEVERE:   Unsupported conversion to class tigase.cluster.repo.ClusterRepoItem when processing from=eventbus@ip-10-0-33-215.us-west-2.compute.internal, to=eventbus@ip-10-0-21-93.us-west-2.compute.internal, DATA=<message xmlns="jabber:client" id="ip-10-0-33-215.us-west-2.compute.internal-4" from="eventbus@ip-10-0-33-215.us-west-2.compute.internal" to="eventbus@ip-10-0-21-93.us-west-2.compute.internal"><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="tigase.cluster.repo.ClusterRepoItemEvent"><item><tigase.cluster.repo.ClusterRepoItemEvent><action>UPDATED</action><item>ip-10-0-21-93.us-west-2.compute.internal:1bec8aab36d1f381630583fd310ac2b02527b455b5eeeea11e129fce8ee29c31:5277:1529242943923:99.99:36.972363:ec2-34-215-29-103.us-west-2.compute.amazonaws.com</item></tigase.cluster.repo.ClusterRepoItemEvent></item></items></event></message>, SIZE=654, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=null
java.lang.RuntimeException: Unsupported conversion to class tigase.cluster.repo.ClusterRepoItem
	at tigase.kernel.DefaultTypesConverter.convert(DefaultTypesConverter.java:325)
	at tigase.eventbus.impl.EventBusSerializer.deserialize(EventBusSerializer.java:72)
	at tigase.eventbus.component.EventReceiverModule.fireEventLocally(EventReceiverModule.java:130)
	at tigase.eventbus.component.EventReceiverModule.process(EventReceiverModule.java:111)
	at tigase.component.modules.StanzaProcessor.process(StanzaProcessor.java:167)
	at tigase.component.modules.StanzaProcessor.processPacket(StanzaProcessor.java:88)
	at tigase.component.AbstractKernelBasedComponent.processPacket(AbstractKernelBasedComponent.java:84)
	at tigase.eventbus.component.EventBusComponent.processPacket(EventBusComponent.java:96)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1367)
Andrzej Wójcik (Tigase) commented 6 years ago

This event was implementing Serializable which forced it to be executed in the cluster scope. Due to that it (and its properties) where serialized on the cluster node which fired this event and then deserialization was happening on the other cluster nodes. Unfortunately, for this to work, all types/classes of event fields need to be either serializable/deserializable or marked as transientbut it was not true for ClusterRepoItem.

As this event is fired on each cluster node when new nodes is found in the cluster nodes repository, there is no point to fire it in the cluster scope. Instead it should be fired in the local node scope (no serizalization needed) and it will be fired on every cluster node as each cluster node will detect change in the list of cluster nodes and will fire it on its own.

Due to that, I've changed this scope to local (removed implements Serializable and empty constructor).

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
7747
Version
tigase-server-8.0.0
Spent time
5h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#956
Please wait...
Page is in error, reload to recover