vanitasvitae / Smack

A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs
https://igniterealtime.org/projects/smack/
Apache License 2.0
16 stars 3 forks source link

Cannot fetch bundles from ejabberd #25

Closed vanitasvitae closed 6 years ago

vanitasvitae commented 7 years ago

When my account is on prosody and their account is on ejabberd 16.09, I cannot fetch their device bundle, because the iq result only arrives 1 sec after the timeout. This is true with timeout 10 secs as well as 50 or 60 secs. Strangely enough fetching device lists works (same procedure, only difference I spotted is missing "max_items=1" in the query. Fetching bundles from prosody <-> prosody works (tested on one server).

I'm not sure, if this is an upstream issue of smack, prosody or ejabberd or just a faulty configuration. Maybe @Flowdalic has heard of something like this/has an idea how to debug this?

vanitasvitae commented 7 years ago

I observed, that bundles only arrive, after another iq was sent to the server. So I send the first iq (id 1) and wait for the response, nothing happens. If I send another iq (id 2) to the server, a response for the first iq (id 1) arrives. This is also true, if I send iq 1 to ejabberd, iq 2 to prosody and again iq 3 to ejabberd. After sending iq 3 to ejabberd, response 1 arrives. So this is highly likely to be an ejabberd bug.

vanitasvitae commented 7 years ago

I created a ejabberd bug report: https://github.com/processone/ejabberd/issues/1710

vanitasvitae commented 7 years ago

May it worth considering to send another small iq to the server with every bundle iq as a workaround? Ask @Flowdalic about this...

vanitasvitae commented 7 years ago

I tried to reproduce the issue by fetching the bundle from ejabberd using conversations on home.zom.im. It took a long time (~80 seconds), but the bundles did arrive. This might be because of other iq requests being sent though...

Flowdalic commented 7 years ago

May it worth considering to send another small iq to the server with every bundle iq as a workaround?

I'd usually have a policy to not implement workarounds for broken XMPP implementations in Smack. They usually cause more trouble (more code to maintain) and decrease the pressure that those broken implementations get fixed.

That is, if we are really talking about a non-Smack issue here.

vanitasvitae commented 7 years ago

Yeah, I guess its just my server installation.

vanitasvitae commented 7 years ago

Reopen: https://community.igniterealtime.org/thread/60891#265181

Flowdalic commented 7 years ago

I remembered where I say this behavior and what is likely causing this too: Whenever you perform a blocking operation in a synchronous IQ handler. Then the connections incoming processing chain will also be blocked, until the operation times out, which will also cause the dammed incoming stanzas to get processed again (which will make them appear in Smack's debugger).

Let's see if we can find that piece of code that is responsible for this.

Flowdalic commented 7 years ago

Where are those bundles fetched?

vanitasvitae commented 7 years ago

@Flowdalic The Bundles are fetched in OmemoService.fetchBundle(). I cannot see anything, which might block :/

vanitasvitae commented 6 years ago

this was fixed a while ago.