1272 Commits

Author SHA1 Message Date
Timothy Bish
7555319dd0 ARTEMIS-5153 Mark federation events and control queues as internal
In order to better indicate their nature as broker feature specific queues
we can mark the temporary queues created for AMQP federation events and
control link messages as internal.
2024-11-14 11:14:19 +00:00
Robbie Gemmell
8a912ed209 ARTEMIS-5110: retire/exclude previously-used IDs removed/reassigned in the following older commits:
177e6820b541e0a71b952eebf503a4d2235910c5
e34fd09ce325a551bf2eaf579854e2e107435502
e065d25b6fb4cdfa7f5b72afd52d6f4771b50634
af9bd7b84aad32e4fe30f2c8909e51cf7300b475
f4bdacbc4cb46b308f80391940890c74bf111ecd
74951d9221b29336c6575de9390a8557114e10eb
fe0ca4d84fc587b701e4b83ae8e5f2240c222842
b08b91a32faa89cdff4403b532e60d96084f2d4a
85857ab8eb1b1eca2498306239740e0e39d2acd4
e02ec69021f24220c0b91b8324382c9630415276
bf9f6d213bf6b3bf4fd7e15430ada8c9954e69ce
2d806807b8d9006cf642392ad5da9878394cebae
52a4157bbb898ee8fd8d7f13fffca71a9c368630
53bb3ea1833cddda6c2ded70d3149286c8207570
d5f152c7254c378707b12ad4a0b798fdb8cb7b10
b3529dcea428fa697aacbceacc6641e47cfb74ba
246bf083914c7acbb05a7fe0904c471331242c39
8a04ee07de8a7c863daf37a07a1176131151caa0
6cb68f2ce923ea3c2400c21967b2003175c8a0f4
9873fccf744c0cb0a25dd905fab67ea52ef7aa7d

See PR for individual commits which were squashed to form this change. This closes #5320
2024-11-01 11:23:13 +00:00
Timothy Bish
a3aea7d9a0 ARTEMIS-5135 Use a sequence ID on address federation link names
Prevents unintended link stealing scenarios when link names match for a new
link whose name is in use by another link still awaiting a detach response.
2024-10-29 10:32:14 +00:00
Justin Bertram
d01ea80df9 ARTEMIS-5110 add ability to identify retired IDs in log annotations
The broker uses unique IDs for logging statements. As logging changes
over time we need a way to "retire" these IDs (e.g. when certain
logging statements are no longer needed) to ensure they are not used

This commit does the following:

 - Removes all the logging methods which are no longer used and
   "retires" the corresponding ID (i.e. adds them to the `retiredIDs`
   list for that LogBundle).
 - Updates the validation for IDs that have been retired or are in
   active use including a new suggestion about a valid ID to use when an
   invalid ID is found.
 - Fixes all the regular expressions in all the various uses of
   `@LogBundle` to ensure there are no overlaps to prevent duplicates
   between bundles.

Changes from myself and Robbie Gemmell (see PR). This closes #5303.
2024-10-25 15:14:07 +01:00
Justin Bertram
24202fc30c
NO-JIRA clarify references to ActiveMQ Classic 2024-10-24 10:49:21 -05:00
Timothy Bish
c78d87de9b ARTEMIS-5106 Mark any AMQP TXN as rollback on send exceptions
If an exception is thrown in the AMQP send path and there is an
active transaction we should mark that as rollback only so the
client will see an error when it tries to commit a transaction
that had a failed send.
2024-10-18 17:36:34 +01:00
Justin Bertram
9380235a5e [maven-release-plugin] prepare for next development iteration 2024-10-16 10:10:37 -05:00
Justin Bertram
241e76f9da [maven-release-plugin] prepare release 2.38.0 2024-10-16 10:08:10 -05:00
Clebert Suconic
6186805b69 ARTEMIS-5090 MirrorSNF is not supposed to expiry on messages 2024-10-09 17:30:26 +01:00
Timothy Bish
65db6c60c9 ARTEMIS-5074 Fix encoding of bytes properties as Binary in AMQPMessage
When a bytes property is added to an AMQPMessage and it is then reencoded it
will fail without first wrapping the byte array in an AMQP binary as required
by the ApplicationProperties section specification defined type allowances.
2024-09-27 19:30:23 +01:00
Clebert Suconic
5808985a6a ARTEMIS-5067 Fix ClusteredMirrorSoakTest::testAutoCreateQueue 2024-09-26 10:15:18 -04:00
Clebert Suconic
0c4c0542be ARTEMIS-5068 Temporary queue should not be mirrored 2024-09-25 21:58:13 -04:00
Clebert Suconic
9199b1f2dc ARTEMIS-5067 Preventing Race when one side is not connected in the mirror
There was already some verification at AMQPMirrorControllerSource::invalidTarget
however the verification failed on soak test ReplicatedBothNodesMirrorTest,
and an user I was working with also gave me evidence of this happening.

I'm improving the previous verification, which is actually a simplification that works on every case.
2024-09-25 21:57:45 -04:00
Clebert Suconic
30c5e63e0b ARTEMIS-5066 Disable Divert on Mirror Target 2024-09-25 21:57:45 -04:00
Clebert Suconic
1d1f03ad5e ARTEMIS-4971 Warning on Unacked messages through mirror AckManager 2024-09-25 09:52:37 -04:00
Timothy Bish
e7ed4700e1 ARTEMIS-5054 Fix concurrent access issue of large message to Stomp Frame
When converting a large server message to an outgoing STOMP frame the converter
is allowing unsafe concurrent access to the large message internals which leads
to failures on message deliver as the state is out of sync amongst the dispatch
threads.
2024-09-25 14:12:33 +01:00
Clebert Suconic
f92a846c21 ARTEMIS-5038 Mirrored ACKs are broken if using multiple priorities on producers
PriorityLinkedList has multiple sub-lists, before this commit PriorityLinkedList::setNodeStore would set the same node store between all the lists.
When a removeWithID was called for an item on list[0] the remove from list[4] would always succeed first. This operation would work correctly most of the time except
when tail and head is being used. Many NullPointerExceptions would be seen while iterating on the list for remove operations, and the navigation would be completely broken.

A test was added to PriorityLinkedListTest to make sure the correct lists were used however I was not able to reproduce the NPE condition in that test.
AccumulatedInPageSoakTest reproduced the exact condition for the NPE when significant load is used.
2024-09-23 11:48:24 -04:00
Laurent Dauvilaire
9702053af2 ARTEMIS-5033 Avoid NPE on method processAddSession in OpenWireConnection
The class org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection in ActiveMQ Artemis
is based on org.apache.activemq.broker.TransportConnection from ActiveMQ Classic,
and in the latter there is null check that doesn't exist in the former.
Therefore, I think it's worth adding this check.

The info should never be null since it is passed in off the wire from the OpenWire marshaller,
and state.getSessionIds() should also never return null because the underlying ConcurrentMap is initialized when ConnectionState is created.
2024-09-10 22:08:52 -05:00
Timothy Bish
5b3b995d61 ARTEMIS-4978 Fix AMQP messages not matching selector on replay
When using the replay functionality the application of filters to
the replayed messages fails to match against AMQP messages due to the
message not getting scanned when some message values are accessed.
2024-09-09 14:34:14 +01:00
Timothy Bish
ec8026e4d6 ARTEMIS-5032 Ensure AMQP message priority is honored after restart
Ensure that on server restart the original priority value assigned to an
AMQP message is used when dispatching durable messages from the store.
The AMQP Header section is scanned if present and the priority value
is recovered in an efficient manner.
2024-09-05 13:56:28 -04:00
Justin Bertram
50c20554d8 ARTEMIS-5034 improve & document OpenWire protocol logging 2024-09-05 11:15:11 -05:00
Clebert Suconic
7fb9aa5f97 ARTEMIS-5010 Addressing deadlock on AckManager
AckManager.flush would hold a lock on ackManager, There was a possible deadlock with MirrorTarget:

Thread 1:

        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.addRetry(AckManager.java:393)
        - waiting to lock <0x00000007990a13e8> (a org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.ack(AckManager.java:418)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.performAck(AMQPMirrorControllerTarget.java:479)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.postAcknowledge(AMQPMirrorControllerTarget.java:461)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.actualDelivery(AMQPMirrorControllerTarget.java:318)
        at org.apache.activemq.artemis.protocol.amqp.proton.ProtonAbstractReceiver.onMessageComplete(ProtonAbstractReceiver.java:361)

Thread 2:

        at jdk.internal.misc.Unsafe.park(java.base@11.0.8/Native Method)
        - parking to wait for  <0x000000079de0af38> (a java.util.concurrent.CountDownLatch$Sync)
        at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.8/LockSupport.java:234)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(java.base@11.0.8/AbstractQueuedSynchronizer.java:1079)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(java.base@11.0.8/AbstractQueuedSynchronizer.java:1369)
        at java.util.concurrent.CountDownLatch.await(java.base@11.0.8/CountDownLatch.java:278)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.flush(AMQPMirrorControllerTarget.java:230)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager$$Lambda$601/0x00000008005c3040.accept(Unknown Source)
        at java.lang.Iterable.forEach(java.base@11.0.8/Iterable.java:75)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.flushMirrorTargets(AckManager.java:184)
        - locked <0x00000007990a13e8> (a org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager)
        at org.apache.activemq.artemis.protocol.amqp.connect.mirror.AckManager.initRetry(AckManager.java:162)
2024-09-04 16:19:52 -04:00
Clebert Suconic
ffafbf350a ARTEMIS-5001 Relax consistency requirement on OperationContext for Mirror send operations.
Send operations should ignore replication, while the ack of the message should wait a round trip in replication.
That will allow us to ack the message faster and still have consistency with its replica.
2024-08-29 14:42:48 -04:00
Clebert Suconic
898c09cb93 ARTEMIS-5010 just a better description on a log.warn 2024-08-28 18:59:05 -04:00
Clebert Suconic
4352ebae5f ARTEMIS-5010 Addressing comments from PR https://github.com/apache/activemq-artemis/pull/5186 2024-08-28 14:08:49 -04:00
Clebert Suconic
4ba9f67d80 ARTEMIS-5010 AckManager records are not replicated 2024-08-28 11:53:16 -04:00
Timothy Bish
18e6f1a88d ARTEMIS-5007 Ensure mirror connection recovers from manual closures
If a user for some reason force closes the local mirror connection SNF
consumer or the actual connection but hasn't stopped the broker connection
itself the connection should recover and rebuild. The fix ensures that if
local connections are closed first then local session resources get freed.
2024-08-27 16:20:18 +01:00
Clebert Suconic
38693370c9 Revert "ARTEMIS-5001 Option to relax sync on journal replication for Mirroring"
This reverts commit d41f01a5aa3722002fc8199eda34198753cc23f2.
2024-08-26 12:49:42 -04:00
Timothy Bish
b58191bd52 ARTEMIS-5004 Clean up federation address consumer bindings proactively
When an address consumer explicitly closes or is closed we should remove the
address binding for that consumer right away instead of waiting for possible
configured auto delete as the demand is gone and we don't need to binding to
stick around any longer.
2024-08-21 17:04:18 +01:00
Clebert Suconic
d41f01a5aa ARTEMIS-5001 Option to relax sync on journal replication for Mirroring
Say you use Mirroring and journal replication combined.

The target will wait a round trip on replica before sends are done.
It is possible to ignore that rountrip now with an option added into Configuration#mirrorReplicaSync
2024-08-20 16:03:57 -04:00
Timothy Bish
c932b75de6 ARTEMIS-4998 Fix Federation link close wrongly closing the connection
The federation sender links can react incorrectly when the source broker
closes a receiver because the demand is gone and they can result in the
remote broker closing its side of the connection causing the whole federation
to need to be rebuilt. Handle the closure events correctly to prevent an
unexpected close and rebuild.
2024-08-20 11:16:16 +01:00
Clebert Suconic
c042fb9e13 [maven-release-plugin] prepare for next development iteration 2024-08-16 10:23:18 -04:00
Clebert Suconic
0ec68a93d3 [maven-release-plugin] prepare release 2.37.0 2024-08-16 10:23:17 -04:00
Clebert Suconic
209f293922 [maven-release-plugin] prepare for next development iteration 2024-08-14 14:39:34 -04:00
Clebert Suconic
de6efc82d1 [maven-release-plugin] prepare release 2.37.0 2024-08-14 14:39:21 -04:00
Timothy Bish
f031481012 ARTEMIS-4982 Cleanup AMQP large message files for rejected sends
When an incoming AMQP large message send is rejected the broker should delete the
large message file as part of the reject handling.
2024-08-12 17:39:51 +01:00
Timothy Bish
be4995a530 ARTEMIS-4969 Ensure AMQP senders can target FQQN if authorized
When using targeted FQQN permissions the AMQP sender needs to check that
it can access not only the address but also the queue if sent an FQQN so
that the security can validate if the sender has been granted directed
access to the FQQN as a whole.
2024-08-06 10:21:57 +01:00
Timothy Bish
8250e611df ARTEMIS-4963 Check send auth on openwire producer create
Check that an attaching Openwire producer has SEND permission on the target
destination and reject it if it does not instead of delaying checks until the
actual send. For anonymous producers check early in the send process to reduce
overhead in the JVM handling messages that are going to fail to send.
2024-08-02 16:38:20 +01:00
Clebert Suconic
fa917ae3fd [maven-release-plugin] prepare for next development iteration 2024-07-25 13:47:10 -04:00
Clebert Suconic
75f17ba64d [maven-release-plugin] prepare release 2.36.0 2024-07-25 13:47:09 -04:00
Clebert Suconic
db0ba73aa4 ARTEMIS-4941 Remove lazy update after application properties only when it's paging
for regular messages it's quite obvious when the message is leaving the queue but for paged messages it becomes a challenge. We should just ignore the update for paged messages.
2024-07-25 13:01:57 -04:00
Clebert Suconic
1a5c2ec51c Revert "ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed"
This reverts commit fb2a57f3ed25895681d3636e3f5fb9d9b9d0a053.
2024-07-25 13:01:57 -04:00
Clebert Suconic
fb2a57f3ed ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed 2024-07-22 15:31:36 -04:00
Timothy Bish
1361e29739 ARTEMIS-4919 Handle Exception from proton transport process
Handle any exceptions from the proton transport and set the error on the
transport for processing in the events dispatch cycle by adding in handling
of the transport error event.
2024-07-15 15:34:21 +01:00
Justin Bertram
fea2be6a3a ARTEMIS-4921 include protocol name in disconnection log message 2024-07-11 10:31:17 -07:00
Justin Bertram
ac5713be81 ARTEMIS-4922 remove spurious warn msg when OpenWire client disconnects 2024-07-11 07:13:49 -07:00
Clebert Suconic
0327fc31d8 ARTEMIS-3509 Concurrent Modification Exception on Stomp Transactions
Co-authored with Anant Sony
2024-07-05 14:30:58 -04:00
Robbie Gemmell
d45349fa67 ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
Updates artemis-log-annotation-processor to use artemis-project so that
artemis-pom can reference artemis-log-annotation-processor without cycle.

Split out its tests to their own module to faciltate, also exercising the
profile mechanism to enable the processor usage with trigger file.

Simplify disabling processing in the module using maven.compiler.proc prop
available since maven-compiler-plugin 3.13.0

Uses a dummy non-processor path at root to 'disable' processsing on JDK < 23,
accounting for Maven 3 not being able to unset maven.compiler.proc from a
parent, and JDKs < 21 requiring newest builds to support -proc:full value
needed otherwise to reenable processing once explicitly disabled.
2024-06-28 16:49:27 +01:00
Justin Bertram
ca73dee630 ARTEMIS-4833 remove redundant type arguments 2024-06-24 10:41:39 -07:00
Justin Bertram
d7cf5dfa44 ARTEMIS-4829 use lambdas consistently
This commit uses lambdas or method references wherever possible. There
are still a handful of places that appear like they could be changed but
couldn't mainly because they use "this" and the meaning of "this"
changes when using a lambda.
2024-06-21 12:01:16 -04:00