-
I checked this issue and for me there where cases in which it worked ok and some in which it failed. I reverted changes in JDBCPubSubDAO which might cause issues with MySQL database, but I suppose that this issue might be related to changes in hashCodeForPacket implementation in PubSub component as it allows 2 requests from same user to be processed in same time which in case of TTS might result in subscription retrieval being processed before subscription is processed.
%wojtek could you look at this in TTS if it may execute this requests in same time? I'm not so familiar with TTS to say if it is possible or not.
-
Actually the TTS executes subsequent stanzas extremely linearly (i.e. it waits for the result from the server before sending anything else). However, after investigation it turns out that component sends out result for the IQ before finalizing updating the data:
2014-11-12 16:54:43.471 [in_1-pubsub] ModulesManager.process() FINEST: Processing packet: from=sess-man@build.xmpp-test.net, to=null, DATA=<iq id="subs1" from="all-xmpp-test@test-d/def-user-resource" to="pubsub.test-d" xmlns="jabber:client" type="set"> <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> <subscriptions node="princely_musings"> <subscription jid="bard@shakespeare.lit" subscription="subscribed"/></subscriptions></pubsub></iq>, SIZE=309, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set 2014-11-12 16:54:43.471 [in_1-pubsub] ModulesManager.process() FINER: Handled by module class tigase.pubsub.modules.ManageSubscriptionModule 2014-11-12 16:54:43.476 [in_1-pubsub] AbstractComponent$1.write() FINER: Sent: <iq id="subs1" from="pubsub.test-d" to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="result"/> 2014-11-12 16:54:43.476 [in_1-pubsub] CachedPubSubRepository.update() FINEST: Node 'princely_musings' added to lazy write queue (subscriptions) 2014-11-12 16:54:43.477 [in_1-pubsub] PubSubDAOJDBC.updateNodeSubscription() FINEST: Updating node subscriptions[1]: princely_musings / UsersSubscription{jid=bard@shakespeare.lit, subid=4ea4pupz86mkbs1btp3, subscription=subscribed} 2014-11-12 16:54:43.481 [in_2-pubsub] ModulesManager.process() FINEST: Processing packet: from=sess-man@build.xmpp-test.net, to=null, DATA=<iq id="subs2" from="all-xmpp-test@test-d/def-user-resource" to="pubsub.test-d" xmlns="jabber:client" type="get"> <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> <subscriptions node="princely_musings"/></pubsub></iq>, SIZE=225, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get 2014-11-12 16:54:43.482 [in_2-pubsub] ModulesManager.process() FINER: Handled by module class tigase.pubsub.modules.ManageSubscriptionModule 2014-11-12 16:54:43.482 [in_2-pubsub] ManageSubscriptionModule.processGet() FINEST: Node subscriptions: princely_musings / [UsersSubscription{jid=all-xmpp-test@test-d, subid=33yszb1ei7d8u5fa1g1, subscription=subscribed}] 2014-11-12 16:54:43.482 [in_2-pubsub] AbstractComponent$1.write() FINER: Sent: <iq id="subs2" from="pubsub.test-d" to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="result"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><subscriptions node="princely_musings"><subscription jid="all-xmpp-test@test-d" subscription="subscribed"/></subscriptions></pubsub></iq> 2014-11-12 16:54:43.483 [in_2-pubsub] ModulesManager.process() FINEST: Finished class tigase.pubsub.modules.ManageSubscriptionModule 2014-11-12 16:54:43.483 [in_1-pubsub] PubSubDAOJDBC.updateNodeSubscription() FINEST: Updating node subscriptions[2]
In the
CachedPubSubRepository
there is a comment:// Prevent node modifications while it is being written to DB
// From 3.0.0 this should not be needed as we keep changes to the node per thread
// synchronized (node) {
so it's not that TTS sends two requests at the same time but nevertheless the second request is processed in different thread hence issues with proper affiliation/subscription/configuration being returned to the client.
Type |
Bug
|
Priority |
Critical
|
Assignee | |
RedmineID |
2328
|
Spent time |
0
|
There are 2 pubsub tests run by TTS and they fail for some databases.