1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-16 01:02:06 +01:00
Commit graph

5200 commits

Author SHA1 Message Date
Florian Schmaus
8e52e80399 Synchronize later in notifyConnectionError(Exception)
especially *after* the sync points have been notified so that a
potential thread currently callin gconnect()/login() throws and leaves
the synchronized section.

This commit is more or less equivalent to
3ded023629 of the 4.3 branch.
2019-03-16 10:43:41 +01:00
Florian Schmaus
3ded023629 Remove 'synchronized' from notifyConnectionError()
as it is not neccessary and causes stalls and deadlocks with a
concurrent connect()/login() (which could be resolved interrupting the
connect()/login() calling thread):

"Smack Reader (0)" daemon prio=5 tid=21 Blocked
  | group="main" sCount=1 dsCount=0 obj=0x12c84670 self=0x7e072ca200
  | sysTid=14965 nice=0 cgrp=default sched=0/0 handle=0x7e06155450
  | state=S schedstat=( 63430626 3034269 21 ) utm=5 stm=0 core=2 HZ=100
  | stack=0x7e06053000-0x7e06055000 stackSize=1037KB
  | held mutexes=
  at org.jivesoftware.smack.tcp.XMPPTCPConnection.notifyConnectionError(XMPPTCPConnection.java:-1)
  - waiting to lock <0x0ec6e6bb> (a org.jivesoftware.smack.tcp.XMPPTCPConnection) held by thread 22
  at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$3900(XMPPTCPConnection.java:154)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1330)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$900(XMPPTCPConnection.java:1064)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:1081)
  at java.lang.Thread.run(Thread.java:761)

"connect" prio=5 tid=22 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x12c8e820 self=0x7e19bcd600
  | sysTid=15047 nice=0 cgrp=default sched=0/0 handle=0x7e05ee4450
  | state=S schedstat=( 14067083 7475835 14 ) utm=1 stm=0 core=0 HZ=100
  | stack=0x7e05de2000-0x7e05de4000 stackSize=1037KB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x0c058b14> (a java.lang.Object)
  at java.lang.Thread.parkFor$(Thread.java:2127)
  - locked <0x0c058b14> (a java.lang.Object)
  at sun.misc.Unsafe.park(Unsafe.java:325)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:840)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
  at java.util.concurrent.Semaphore.acquire(Semaphore.java:446)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection.initConnection(XMPPTCPConnection.java:685)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:942)
  at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:417)
  - locked <0x0ec6e6bb> (a org.jivesoftware.smack.tcp.XMPPTCPConnection)
  at org.yaxim.androidclient.service.SmackableImp.connectAndLogin(SmackableImp.java:717)
  - locked <0x0ec6e6bb> (a org.jivesoftware.smack.tcp.XMPPTCPConnection)
  at org.yaxim.androidclient.service.SmackableImp.doConnect(SmackableImp.java:304)
  at org.yaxim.androidclient.service.SmackableImp$5.run(SmackableImp.java:391)
2019-03-16 10:42:36 +01:00
Florian Schmaus
29af92cbd1 Smack 4.3.4-SNAPSHOT 2019-03-15 09:43:09 +01:00
Florian Schmaus
daab6039a1 Smack 4.3.3
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlyKV9tfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFL4vQf/Qfg3VzNEnmk0+KjOtuvfAbhMfzE92gfo15vE0PPEIe9VA0Pzkvqhva4k
 Efw7BhD2zx8hWvo0d5FfkdII89hSYnOCiSmhiX1Ln9q/gUqFW0TDAKpsMfAl7jAK
 Fap8M7uUStP9T6fF/gq01djYCYoWA/4v1lGKv4J4b9gWCqzGIF2sK0M7of7VERnr
 pEXJSUM228rk6EYjVmX/9Ujo1Y+xaNMFFZZSbKYrirAqjP540v0OPBCRQyB8qFaI
 NTcNJ+qESe6Q80mw5V+y/kD6kX0LERSDB+pigzOOOlmfMtD1uADR84tAynuTKNAU
 7/5K/YSQxceRY6RTgD17Al5lHIH5nw==
 =ToR+
 -----END PGP SIGNATURE-----

Merge tag '4.3.3'

Smack 4.3.3
2019-03-14 18:23:33 +01:00
Florian Schmaus
b054c4fe77 Smack 4.3.3 2019-03-14 14:31:09 +01:00
Florian Schmaus
0de0873abb version.gradle: Add link to SMACK-858 2019-03-14 14:29:23 +01:00
Heckel
3d3d89612f PingManager: Assume server ping successful if stanzas where received
We assume that the connection is good even if there was no ping
result but a stanzas within the ping interval.

In some case we have produced so much load, that the ping result
was not delivered in time because so many other packets were
delivered before.
2019-03-14 12:42:46 +01:00
Georg Lukas
e5bbd19ef1 StanzaDroppedListener for XEP-0198 resumption failures
If a stream resume fails, smack will re-send all queued stanzas after a
reconnect. However, it does not make sense to re-send them:

* IQs / IQ responses have probably timed out
* MUC messages and PMs will be rejected as you haven't rejoined yet
* regular messages should be amended with a <delay> element

This patch adds a StanzaDroppedListener interface to the
XMPPTCPConnection. If at least one StanzaDroppedListener is provided,
all queued messages will be drained into the StanzaDroppedListener(s).
Otherwise, the original behavior of attempting to transmit them will be
followed.

Discussion: https://discourse.igniterealtime.org/t/xep-0198-resume-failure-reconnect-resending-of-muc-messages/83510/3

Signed-off-by: Georg Lukas <georg@op-co.de>
2019-03-10 21:24:37 +01:00
Florian Schmaus
569f7417a8 Add AuthenticatedConnectionInitiallyEstablished timestamp 2019-03-10 21:24:37 +01:00
Florian Schmaus
c4289b2c18 Add AbstractXMPPConnection.initState()
and init/reset the sychronization points there.

This method is called right at the beginning of connect() and at the
end of shutdown().
2019-03-10 21:24:37 +01:00
Florian Schmaus
7518bf9a25 Add descriptive text to StanzaError.toString() 2019-03-10 21:24:37 +01:00
Florian Schmaus
5da6dea138 Throw exception to reduce call sites of notifyConnectionError()
in XMPPTCPConnection.
2019-03-10 21:24:37 +01:00
Florian Schmaus
7d2c3ac9f9 Do not call synchronized methods in reader/writer thread
This may cause deadlocks with a call to acquire(2) on the introduced
readerWriterSemaphore in initConnection(), which is also synchronized.
2019-03-10 21:24:37 +01:00
Florian Schmaus
3d1a781a22 Show correct reply timeout value in StanzaCollector's NoResponseException 2019-03-05 08:21:59 +01:00
Florian Schmaus
7f0932a481 Reset the MUC self-presence collector on presence stanzas on join
To prevent timeouts when joining very large MUCs we now reset the
self-presence collector's timeout for every other (occupant) presence
we receive.

Fixes SMACK-859.
2019-03-04 23:01:52 +01:00
Florian Schmaus
f602de8771 Call shutdown() in connect() on exception
to clean up the state build up by connect().

Related to SMACK-855 there is the possiblitiy of a stray (writer)
thread if, for example, tlsHandled.checkifSuccessOrWaitorThrow() in
XMPPTCPConnection.connectInternal() throws. This commit should prevent
that.
2019-03-04 20:14:12 +01:00
Florian Schmaus
f4ebd530e6 Add note about module dependencies to JavaxResolver
Related to SMACK-856.
2019-03-02 14:47:28 +01:00
Florian Schmaus
78ee22c261 Revert "Do not set com.sun.jndi.dns.DnsContextFactory in JavaxResolver"
This reverts commit ac9641f091.

Reverted because now an NoInitialContextException is now thrown.

Related to SMACK-856.
2019-03-02 14:42:19 +01:00
Florian Schmaus
456d645e27 Use different version specifier for jxmpp and MiniDNS
Fixes SMACK-858.
2019-02-24 22:09:47 +01:00
Florian Schmaus
3bdc1d30b1 Correctly name provider INSTANCE fields
and make them 'final' where possible.
2019-02-23 23:59:17 +01:00
Florian Schmaus
5f7cfd04bd Add further unit test to StableUniqueStanzaIdTest 2019-02-23 23:59:17 +01:00
Florian Schmaus
5a2109e73f Move cast in extra line in ADD_ORIGIN_ID_INTERCEPTOR 2019-02-23 23:40:27 +01:00
Florian Schmaus
4da4558b29 Make origin-id interceptor static and rename it 2019-02-23 23:39:58 +01:00
Florian Schmaus
27749b2137 Remove unused filter in StableUniqueStanzaIdManager 2019-02-23 23:39:41 +01:00
Florian Schmaus
2b9cbb978e Enable full stacktraces of failed tests in console 2019-02-22 23:02:40 +01:00
Florian Schmaus
2ef9b99e9c Smack 4.3.2
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlxvsT9fFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFIbnggAp5nNJB0OCrZ2KxuWG9b0t6pZEsfjMM5S6dT0Pzi+6JnZMkK9tP8IRUH2
 m5u5CLbVcwqbqy4ybkB3jTgBmUkHanGjM19/NDSHS2G8GEa8cXwQOEx4DeklXlDI
 iSRprlRY7s23/e5kxGi7X/EzIxK4HpmZiXUWxnLHliI5eBA+MSJM3UJdVhyrsgUc
 rEcMcPYKQU7D5v4fhCoFzzdivJio8TBt68fUqVjFZDCnVGzCKMieYCeC7RR45j7M
 m68amW3dqqK2fxDMgoai9IjEZr4rRvuF7kTKPPuEq77MkfhNdid8eow7PHYNIhe0
 Vd9CgUqOHQSQ1fcthIC3dr3uUKnOog==
 =0VIN
 -----END PGP SIGNATURE-----

Merge tag '4.3.2'

Smack 4.3.2
2019-02-22 10:58:23 +01:00
Florian Schmaus
47f76952e3 Smack 4.3.3-SNAPSHOT 2019-02-22 10:57:48 +01:00
Florian Schmaus
a8044f723a Smack 4.3.2 2019-02-22 09:22:23 +01:00
Florian Schmaus
be10a6e850 Return Set instead of HashSet in UndecidedOmemoIdentityException 2019-02-18 11:39:49 +01:00
Florian Schmaus
825a5836eb Merge branch '4.3' 2019-02-17 22:28:01 +01:00
Florian Schmaus
e9b514548b Filter error messages in DeliveryReceiptManager 2019-02-17 22:27:38 +01:00
Florian Schmaus
db8e37d75f Reduce scope of catched Exceptions in JavaxResolver 2019-02-17 22:27:38 +01:00
Florian Schmaus
eccaf58df1 Add Logger to JavaxResolver 2019-02-17 22:27:38 +01:00
Florian Schmaus
ac9641f091 Do not set com.sun.jndi.dns.DnsContextFactory in JavaxResolver
as this is not accessible in newer Java versions (at least 11).

Fixes SMACK-856.
2019-02-17 22:27:38 +01:00
Florian Schmaus
488e20476e Improve message of StressTestFailedException.NotAllMessagesReceivedException 2019-02-17 21:47:16 +01:00
Florian Schmaus
b3ed9bc29f Add BooleansUtils 2019-02-17 18:21:57 +01:00
Florian Schmaus
8ed872ca63 PubSubIntegrationTest: Add workaround for ejabberd issue #2799 2019-02-17 17:51:37 +01:00
Florian Schmaus
9f3d2d2f28 Log if reported XMPP domain does not match expected 2019-02-16 21:54:11 +01:00
Florian Schmaus
12bd76a011 s/@since 4.4/@since 4.4.0/ 2019-02-16 17:17:50 +01:00
Florian Schmaus
85f7e1d39c Remove deprecated methods scheduled for removal in Smack 4.4 2019-02-16 17:17:25 +01:00
Florian Schmaus
8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus
43bb418d99 Call onOpenStream() in XmppNioTcpConnection 2019-02-15 23:17:12 +01:00
Florian Schmaus
b3801b984a Use PacketParserUtils in OpenIQProviderTest 2019-02-15 23:16:11 +01:00
Florian Schmaus
ae208d6a2f
Merge pull request #292 from igniterealtime/guusdk-patch-1
To many s'ses
2019-02-14 16:13:30 +01:00
Florian Schmaus
c0a64078c5 build.gradle: Lazily evaluate Android related arguments 2019-02-14 12:29:54 +01:00
Guus der Kinderen
4d3fde4b38
To many s'ses 2019-02-14 10:37:53 +01:00
Florian Schmaus
a13829aa74 Add javadoc to Smack(Message|Wrapped)Exception 2019-02-10 21:55:07 +01:00
Florian Schmaus
394f3d133a Make SmackException abstract 2019-02-10 21:53:31 +01:00
Florian Schmaus
7e76712c46 Make SASLAuthentication.authenticationFailed(Exception) private 2019-02-10 21:51:01 +01:00
Florian Schmaus
7fce6b5a98 Introduce SmackMessageException 2019-02-10 21:50:39 +01:00