Author |
Message
|
riyaz_tak |
Posted: Thu Feb 16, 2012 12:00 am Post subject: AMQ9209: Connection to host 'localhost (127.0.0.1)' closed |
|
|
Voyager
Joined: 05 Jan 2012 Posts: 92
|
Hi
We have one script which search for the PID of MQ and kill it forcefully.
In this scenario we get
AMQ9209: Connection to host 'localhost (127.0.0.1)' closed error.
We did some investigation and found out that if messages are still there in queue and they are getting processed and in between we kill the process the we get above error.
So my question is how can we avoid it?
How can we make sure that it process all the message before getting closed?
Please let me if you require more info. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 16, 2012 5:00 am Post subject: Re: AMQ9209: Connection to host 'localhost (127.0.0.1)' clos |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
riyaz_tak wrote: |
So my question is how can we avoid it? |
Don't run the script?
Seriously, there is no good reason to forcefully kill any of the WMQ processes. There are some reasons to do this, all of them involve something bad already happening and probably also involve a PMR & the blessing of IBM Support.
If you're doing it so frequently you've scripted it there's something very wrong with your setup and/or your installation.
riyaz_tak wrote: |
How can we make sure that it process all the message before getting closed? |
You can try shutting down all the WMQ processes with the commands provided. If you have a situation where it's essential that messages in a queue are processed before shutdown the application can be designed to ignore any shutdown request until it's finished, and the queue manager instructed to close only when the application signals it's finished with the queue.
riyaz_tak wrote: |
Please let me if you require more info. |
Perhaps if you told us what you're trying to achieve rather than what you're doing? Whatever it is, issuing a kill command should be a last resort rather than the scripted first action. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
JasonE |
Posted: Thu Feb 16, 2012 5:01 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Which PID - how do you identify this, is it your user application, or amq* processes
Quote: |
and kill it forcefully |
Why?
Quote: |
In this scenario we get AMQ9209: Connection to host 'localhost (127.0.0.1)' closed error. |
Sounds like the process you kill has an open channel into the queue manager, and hence when it is killed, an error is detected.
Quote: |
So my question is how can we avoid it? |
Decide why you feel you need to forcibly terminate something rather than a more controlled shutdown |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 16, 2012 6:38 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
What version/release of MQ are you running?
What o/s? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
riyaz_tak |
Posted: Thu Feb 16, 2012 9:21 pm Post subject: |
|
|
Voyager
Joined: 05 Jan 2012 Posts: 92
|
It's MQ7 and os is solaris |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 17, 2012 5:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
riyaz_tak wrote: |
It's MQ7 and os is solaris |
Which is useful information but still doesn't answer the basic question of why you're using kill -9 in a script on a WMQ process. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
riyaz_tak |
Posted: Tue Feb 28, 2012 5:38 am Post subject: |
|
|
Voyager
Joined: 05 Jan 2012 Posts: 92
|
Sorry for late reply
I was bit wrong in my analysis.
In our application we have client app and MQ manager on same machine.
We are closing down all the socket properly when shutdown script is ran.
But still we are seeing
AMQ9209: Connection to host 'localhost (127.0.0.1)' closed.
EXPLANATION:
An error occurred receiving data from 'localhost (127.0.0.1)' over TCP/IP. The
connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
12/01/11 10:00:54 - Process(xxxx) User(root) Program(xxxxx)
Host(xxxxx)
AMQ9999: Channel program ended abnormally.
EXPLANATION:
Channel program 'xxxxxx.CH' ended abnormally.
ACTION:
Look at previous error messages for channel program 'xxxxxx.CH' in the
error files to determine the cause of the failure.
Please help me to identify root cause.
I am closing all the sockets properly but atill seeing this error in MQ log. |
|
Back to top |
|
 |
JasonE |
Posted: Tue Feb 28, 2012 5:48 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Most likely your client has not disconnected before it ends. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 28, 2012 5:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
riyaz_tak wrote: |
We are closing down all the socket properly when shutdown script is ran. |
If this is the script where the the kill -9 is being issued then something is not being closed properly because that's the nature of the -9 signal.
riyaz_tak wrote: |
Please help me to identify root cause.
I am closing all the sockets properly but atill seeing this error in MQ log. |
The root cause is this shutdown script. In WMQ terms you shouldn't be talking or thinking in terms of "sockets"; you should be thinking in terms of queue manager connections, especially if you're using client. Your WMQ shutdown script should be using WMQ commands to close the queue manager, and your application should close it's connection before ending (which it won't if you stop it with a kill -9). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
riyaz_tak |
Posted: Tue Feb 28, 2012 11:02 am Post subject: |
|
|
Voyager
Joined: 05 Jan 2012 Posts: 92
|
Thanks for the reply.
kill -9 will come into picture only when everything else fails.
So if kill -9 is not the culprit then I guess connection is getting closed properly.But i have checked the code and all are getting closed properly.
Thats why I am wondering what could be the issue.
So how to disconnect properly so that client disconnects before it ends? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 28, 2012 11:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
riyaz_tak wrote: |
kill -9 will come into picture only when everything else fails. |
Define "everything else". There are a number of options to bring down a queue manager even if there is a hung connection from a badly behaving app. So again, why are you using kill -9 and why so frequently that you script it?
Likewise using kill -9 on the client application will leave any connection it has hanging, giving you the result you posted. That's the nature of that signal.
riyaz_tak wrote: |
So if kill -9 is not the culprit then I guess connection is getting closed properly. |
How have we eliminated it as a culprit? You've got it in a script you run.
riyaz_tak wrote: |
But i have checked the code and all are getting closed properly. |
If there's no problem with the code and you're not issuing preemptive signal commands then nothing's wrong and you don't have an issue.
riyaz_tak wrote: |
Thats why I am wondering what could be the issue. |
It's not working the way you think it's working / designed to be working.
riyaz_tak wrote: |
So how to disconnect properly so that client disconnects before it ends? |
Write code that disconnects, which is not always the same as deleting the WMQ object. You don't mention what language the client application is written in or what connection strategy it's using so it's hard to be clear.
The queue manager can't disconnect. The best it can do is "hang up" on the client. If it's a business requirement that the application be allowed to finish then this isn't a good idea. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|