You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by akabhishek1 <ma...@gmail.com> on 2021/02/04 23:56:50 UTC

Getting jms.provider.ProviderException with closed session - Qpid-56

Hi Team,

We recently upgraded Qpid library to "qpid-jms-client-0.56.0" and started
getting ProviderException with session closed error while communicating with
ServiceBus broker.

We are trying to reproduce ProviderException with closed session. 

Scenario :
1. Publish message
2. Got illegalStateException - The MessageProducer is closed/The
MessageProducer was closed due to an unrecoverable error.
3. ResetPoducer -- (Assuming session is not closed) --> Which throws "The
Session was closed due to an unrecoverable error."
4. ProviderException -- "Unknown error from remote peer" --> why are we
getting this exception as well in error call stack?

Please find attached "ProviderException_SessionClosed_Qpid.json" and
SessionClosed_ProviderException.PNG.

We are cleared upto ResetPoducer issue but not cleared with
ProviderException. 

If you check attached stack trace there is no directly link between
IllegalStateException and ProviderException.

We have fixed ResetPoducer but not able to fix ProviderException issue,
because we are not able to generate this issue.

Could you please check attached stack trace and help with below queris - 
1. Is ProviderException being generated by
"org.apache.qpid.jms.JmsSession.checkClosed" ? Please refer error
Array[1]-parsedStack[0]
2. How can we generate ProviderException while creating destination ? Please
refer error Array[1]-parsedStack[1]

Could you please let us know your thought, it will help us to close this
issue. Let me know for any query.

ProviderException_SessionClosed_Qpid.json
<http://qpid.2158936.n2.nabble.com/file/t396358/ProviderException_SessionClosed_Qpid.json>  

SessionClosed_ProviderException.PNG
<http://qpid.2158936.n2.nabble.com/file/t396358/SessionClosed_ProviderException.PNG>  

 
Regards,
Abhishek Kumar



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Getting jms.provider.ProviderException with closed session - Qpid-56

Posted by Robbie Gemmell <ro...@gmail.com>.
The process is performed as your stack largely already shows overall,
with bytes arriving from netty, being given to and decoded by
proton-j, determined to be an End frame for a particular session and
causing the effect in proton, and the resulting event handling in the
client triggering the rest of the process. There isnt isnt a simple
'pretend remote close happened' button you can use, for full effect
you'll actually need to remotely close the session as I said.

I didnt mean a Service Bus test server, rather a test-specific
substitute AMQP 1.0 server. There are various options for creating
lightweight servers, e.g such as Qpid Proton, and to an extent
Proton-J though only at a lower level, but if you are wanting to use
Java the simplest option is probably over at Vert.x leveraging
proton-j as an engine. For example you might find some inspiration
from the following example and test.
https://github.com/vert-x3/vertx-proton/blob/4.0.2/src/test/java/io/vertx/proton/example/HelloWorldServer.java
https://github.com/vert-x3/vertx-proton/blob/4.0.2/src/test/java/io/vertx/proton/ProtonClientTest.java#L859

Do note each connection is single threaded and can only used from its
callbacks and/or on its vertx context (e.g timers created while in the
callback / on the context). See also
https://github.com/vert-x3/vertx-proton/blob/3.5/src/main/asciidoc/java/index.adoc#threading-considerations.



On Wed, 10 Feb 2021 at 19:41, akabhishek1
<ma...@gmail.com> wrote:
>
> Hey Robbie,
>
> Thank you so much update. As always, your input helps alot to fix/understand
> issue.
>
> We don't have ServiceBus test server and Microsoft also can't help us to
> close session remotely.
>
> So, we  have only one option reproduce this issue - forcefully break
> existing JMS session either in debug or test mode.
>
> I am able to genearate slightly same error with setting below value in Debug
> mode while creating JMS Destination
>         1.  closed.set(true)
>         2. failureCause.set(new ProviderException("Unknown error from remote
> peer"))
>
>          protected void checkClosed() throws IllegalStateException {
>                         if (closed.get()) {
>                                 IllegalStateException jmsEx = null;
>                                 if (failureCause.get() == null) {
>                                         jmsEx = new IllegalStateException("The Session is closed");
>                                 } else {
>                                         jmsEx = new IllegalStateException("The Session was closed due to an
> unrecoverable error.");
>                                         jmsEx.initCause(failureCause.get());
>                                 }
>                                 throw jmsEx;
>                         }
>                 }
>
>
> In actual scenario, JmsSession.setFailureCause() and
> JmsSession.closed.set(true) getting called from proton/Netty library. Refer
> -  Netty_Call_Hierarchy.PNG
> <http://qpid.2158936.n2.nabble.com/file/t396358/Netty_Call_Hierarchy.PNG>
>
> We want to generate same error forcefully with Qpid-Proton library. I
> checked the call hierarchy of JmsSession.setFailureCause() which is getting
> set by AmqpAbstractResource.processRemoteClose method - refer
> SetFailureCause_Hierarchy.PNG
> <http://qpid.2158936.n2.nabble.com/file/t396358/SetFailureCause_Hierarchy.PNG>
>
> Can you please guide us source location of Netty/proton class which
> derives/triggers to close JMS session and .setFailureCause().
>
> It will really help us to forcefully generate actual error. Please let me
> know for any input.
>
> Thanks again for help!!
>
> Regards,
> Abhishek Kumar
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Getting jms.provider.ProviderException with closed session - Qpid-56

Posted by akabhishek1 <ma...@gmail.com>.
Hey Robbie,

Thank you so much update. As always, your input helps alot to fix/understand
issue.

We don't have ServiceBus test server and Microsoft also can't help us to
close session remotely.

So, we  have only one option reproduce this issue - forcefully break
existing JMS session either in debug or test mode.

I am able to genearate slightly same error with setting below value in Debug
mode while creating JMS Destination
	1.  closed.set(true) 
        2. failureCause.set(new ProviderException("Unknown error from remote
peer"))

	 protected void checkClosed() throws IllegalStateException {
			if (closed.get()) {
				IllegalStateException jmsEx = null;
				if (failureCause.get() == null) {
					jmsEx = new IllegalStateException("The Session is closed");
				} else {
					jmsEx = new IllegalStateException("The Session was closed due to an
unrecoverable error.");
					jmsEx.initCause(failureCause.get());
				}
				throw jmsEx;
			}
		}


In actual scenario, JmsSession.setFailureCause() and
JmsSession.closed.set(true) getting called from proton/Netty library. Refer
-  Netty_Call_Hierarchy.PNG
<http://qpid.2158936.n2.nabble.com/file/t396358/Netty_Call_Hierarchy.PNG>  

We want to generate same error forcefully with Qpid-Proton library. I
checked the call hierarchy of JmsSession.setFailureCause() which is getting
set by AmqpAbstractResource.processRemoteClose method - refer 
SetFailureCause_Hierarchy.PNG
<http://qpid.2158936.n2.nabble.com/file/t396358/SetFailureCause_Hierarchy.PNG>  

Can you please guide us source location of Netty/proton class which
derives/triggers to close JMS session and .setFailureCause(). 

It will really help us to forcefully generate actual error. Please let me
know for any input.

Thanks again for help!!

Regards,
Abhishek Kumar



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Getting jms.provider.ProviderException with closed session - Qpid-56

Posted by Robbie Gemmell <ro...@gmail.com>.
Remote session closure, coupled with ongoing client activity, is
inherently a bit of a race. You may perform a new operation which
itself has to fail, because the resource is now/being closed. You are
going to get an exception through the Exception Listener, because its
generally an unexpected event (though seemingly not for ServiceBus),
and there may be no other way to know there is an issue with the
session or connection if you dont actively use them. You also have
message listeners, consumers which will specifically never ever find
out about such a problem otherwise unless that is done, because they
do no operations until future messages arrive, which they never will
as a result of the unexpected remote closure.

In order to reproduce the reaction to a server remotely closing the
session, you would need a test server that remotely closes the
session.

On Thu, 4 Feb 2021 at 23:56, akabhishek1
<ma...@gmail.com> wrote:
>
> Hi Team,
>
> We recently upgraded Qpid library to "qpid-jms-client-0.56.0" and started
> getting ProviderException with session closed error while communicating with
> ServiceBus broker.
>
> We are trying to reproduce ProviderException with closed session.
>
> Scenario :
> 1. Publish message
> 2. Got illegalStateException - The MessageProducer is closed/The
> MessageProducer was closed due to an unrecoverable error.
> 3. ResetPoducer -- (Assuming session is not closed) --> Which throws "The
> Session was closed due to an unrecoverable error."
> 4. ProviderException -- "Unknown error from remote peer" --> why are we
> getting this exception as well in error call stack?
>
> Please find attached "ProviderException_SessionClosed_Qpid.json" and
> SessionClosed_ProviderException.PNG.
>
> We are cleared upto ResetPoducer issue but not cleared with
> ProviderException.
>
> If you check attached stack trace there is no directly link between
> IllegalStateException and ProviderException.
>
> We have fixed ResetPoducer but not able to fix ProviderException issue,
> because we are not able to generate this issue.
>
> Could you please check attached stack trace and help with below queris -
> 1. Is ProviderException being generated by
> "org.apache.qpid.jms.JmsSession.checkClosed" ? Please refer error
> Array[1]-parsedStack[0]
> 2. How can we generate ProviderException while creating destination ? Please
> refer error Array[1]-parsedStack[1]
>
> Could you please let us know your thought, it will help us to close this
> issue. Let me know for any query.
>
> ProviderException_SessionClosed_Qpid.json
> <http://qpid.2158936.n2.nabble.com/file/t396358/ProviderException_SessionClosed_Qpid.json>
>
> SessionClosed_ProviderException.PNG
> <http://qpid.2158936.n2.nabble.com/file/t396358/SessionClosed_ProviderException.PNG>
>
>
> Regards,
> Abhishek Kumar
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org