Issue #2368 - apply java qpid patch

Former-commit-id: 1f29b62624650652a4a1b347dfd70fc161be0f5e
This commit is contained in:
Bryan Kowal 2013-09-16 16:15:50 -05:00
parent 6443fd555b
commit d6eca92d11
3 changed files with 151 additions and 21 deletions

View file

@ -0,0 +1,137 @@
diff -crB a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
*** a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java 2012-06-28 11:46:12.000000000 -0500
--- b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java 2013-09-16 13:26:48.000000000 -0500
***************
*** 38,47 ****
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
public abstract class QueueEntryImpl implements QueueEntry
{
! private static final Logger _log = Logger.getLogger(QueueEntryImpl.class);
private final QueueEntryList _queueEntryList;
--- 38,48 ----
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+ import java.util.logging.Level;
public abstract class QueueEntryImpl implements QueueEntry
{
! private static final java.util.logging.Logger _log = java.util.logging.Logger.getLogger(QueueEntryImpl.class.getName());
private final QueueEntryList _queueEntryList;
***************
*** 145,156 ****
ServerMessage message = getMessage();
if(message != null)
{
! long expiration = message.getExpiration();
! if (expiration != 0L)
! {
! long now = System.currentTimeMillis();
! return (now > expiration);
}
}
return false;
--- 146,162 ----
ServerMessage message = getMessage();
if(message != null)
{
! try {
! long expiration = message.getExpiration();
! if (expiration != 0L)
! {
! long now = System.currentTimeMillis();
! return (now > expiration);
! }
! } catch (Exception e) {
! _log.log(Level.SEVERE, "Caught exception checking if message is expired. Message State: " + _state.getState().name(), e);
! return isAvailable();
}
}
return false;
***************
*** 343,349 ****
}
else
{
! _log.warn("Requesting rejection by null subscriber:" + this);
}
}
--- 349,355 ----
}
else
{
! _log.warning("Requesting rejection by null subscriber:" + this);
}
}
diff -crB a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
*** a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java 2012-07-08 10:30:05.000000000 -0500
--- b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java 2013-09-16 14:15:11.000000000 -0500
***************
*** 36,41 ****
--- 36,42 ----
import java.util.concurrent.atomic.AtomicLong;
import org.apache.log4j.Logger;
+ import org.apache.log4j.Level;
import org.apache.qpid.AMQException;
import org.apache.qpid.AMQSecurityException;
import org.apache.qpid.framing.AMQShortString;
***************
*** 1053,1060 ****
public long getOldestMessageArrivalTime()
{
! QueueEntry entry = getOldestQueueEntry();
! return entry == null ? Long.MAX_VALUE : entry.getMessage().getArrivalTime();
}
protected QueueEntry getOldestQueueEntry()
--- 1054,1090 ----
public long getOldestMessageArrivalTime()
{
! int tries = 0;
! QueueEntry prev = null;
!
! while (tries < 3) {
! QueueEntry entry = null;
! try {
! entry = getOldestQueueEntry();
! return entry == null ? Long.MAX_VALUE : entry.getMessage().getArrivalTime();
! } catch (Exception e) {
! if ((prev == null) || (prev != entry)) {
! tries++;
! _logger.log(Level.FATAL,
! "Error occurred getting oldest message arrival time, message: "
! + entry + ", attempt " + tries + " of 3", e);
! prev = entry;
! } else {
! // same invalid entry returned, try deleting?
! _logger.log(Level.WARN,
! "Received same invalid entry on getting oldest message, attempting discard.");
! try {
! entry.discard();
! } catch (Exception e2) {
! _logger.log(Level.ERROR,
! "Failed to discard message. Restart recommended if errors continue", e2);
! }
! }
! }
! }
!
! // default case
! return Long.MAX_VALUE;
}
protected QueueEntry getOldestQueueEntry()

View file

@ -1,6 +1,6 @@
diff -crB a/qpid-java.spec b/qpid-java.spec
*** a/qpid-java.spec 2013-06-26 13:14:00.000000000 -0500
--- b/qpid-java.spec 2013-06-26 13:12:59.000000000 -0500
*** a/qpid-java.spec 2013-09-16 11:37:50.000000000 -0500
--- b/qpid-java.spec 2013-09-16 11:39:37.000000000 -0500
***************
*** 1,6 ****
! Name: qpid-java
@ -20,7 +20,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Group: Development/Java
***************
*** 12,21 ****
--- 14,31 ----
--- 14,29 ----
Source0: %{qpid_src_dir}.tar.gz
Source1: qpid-build-deps-%{version}.tar.gz
Source2: %{qpid_deps_src_dir}.tar.gz
@ -28,14 +28,12 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
+ Source4: virtualhosts.xml
+ Source5: qpidd
+ Source6: log4j.xml
+ Source7: qpid-wrapper
+ Source8: wrapper.conf
+ Source9: yajsw-distribution.tar
Patch0: mrg.patch
Patch1: examples.patch
Patch2: build.patch
+ Patch3: awips.patch
+ Patch4: qpid-messageNotFound.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -52,7 +50,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Requires: log4j >= 1.2.12
%description client
--- 45,64 ----
--- 43,62 ----
%description common
Java implementation of Apache Qpid - common files
@ -82,7 +80,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%description example
Java implementation of Apache Qpid - example
--- 68,74 ----
--- 66,72 ----
Summary: Java implementation of Apache Qpid - example
Group: Development/Java
BuildArch: noarch
@ -92,7 +90,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Java implementation of Apache Qpid - example
***************
*** 58,67 ****
--- 77,101 ----
--- 75,100 ----
%setup -q -n %{qpid_src_dir}
mkdir -p java/lib/required
tar -xvzf %SOURCE1 -C java/lib/required
@ -115,6 +113,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%patch2 -p2
+ # apply the awips patch
+ %patch3 -p2
+ %patch4 -p2
%setup -q -T -b 2 -n %{qpid_deps_src_dir}
@ -127,7 +126,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
# blacklisted jars are either provided by the Requires: or not needed.
BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests"
--- 104,118 ----
--- 103,117 ----
(
cd %{qpid_src_dir}/java
@ -192,7 +191,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%changelog
* Thu Sep 6 2012 Irina Boverman <iboverma@redhat.com> - 0.18-2
--- 126,247 ----
--- 125,236 ----
cd ..
@ -217,14 +216,6 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
! # scripts for broker
! install -dm 755 %{buildroot}%{_awips2_directory}/bin
! install -pm 644 %{qpid_src_dir}/java/build/bin/* %{buildroot}%{_awips2_directory}/bin
! # install the wrapper script
! install -pm 644 %SOURCE7 %{buildroot}%{_awips2_directory}/bin
! # add the yajsw distribution
! tar -xf %SOURCE9 -C %{buildroot}%{_awips2_directory}/bin
!
! # wrapper configuration
! install -dm 755 %{buildroot}%{_awips2_directory}/conf
! install -pm 644 %SOURCE8 %{buildroot}%{_awips2_directory}/conf
!
! # service script
! mkdir -p %{buildroot}/etc/init.d
@ -299,8 +290,6 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
! /awips2/qpid/lib/opt/qpid-broker-plugins-firewall-%{version}.jar
! /awips2/qpid/lib/opt/qpid-broker-plugins-management-http-%{version}.jar
! %dir /awips2/qpid/log
! %dir /awips2/qpid/conf
! /awips2/qpid/conf/*
! %defattr(755,awips,fxalpha,755)
! %dir /awips2/qpid/bin
! /awips2/qpid/bin/*

View file

@ -5,6 +5,10 @@ if [ -z ${WORKSPACE} ]; then
echo "Error: the location of the baseline workspace must be specified using the WORKSPACE environment variable."
exit 1
fi
if [ -z ${AWIPSII_BUILD_ROOT} ]; then
echo "Error: the location of the AWIPS II build root must be specified using the AWIPSII_BUILD_ROOT environment variable."
exit 1
fi
__SPECS=qpid-java.spec
__SPECS_PATCH0=qpid-java.spec.patch0