ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » AMQ9209: Connection to host 'localhost (127.0.0.1)' closed

Post new topic  Reply to topic
 AMQ9209: Connection to host 'localhost (127.0.0.1)' closed « View previous topic :: View next topic » 
Author Message
riyaz_tak
PostPosted: Thu Feb 16, 2012 12:00 am    Post subject: AMQ9209: Connection to host 'localhost (127.0.0.1)' closed Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Feb 16, 2012 5:00 am    Post subject: Re: AMQ9209: Connection to host 'localhost (127.0.0.1)' clos Reply with quote

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
View user's profile Send private message
JasonE
PostPosted: Thu Feb 16, 2012 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Quote:
for the PID of MQ

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
View user's profile Send private message
bruce2359
PostPosted: Thu Feb 16, 2012 6:38 am    Post subject: Reply with quote

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
View user's profile Send private message
riyaz_tak
PostPosted: Thu Feb 16, 2012 9:21 pm    Post subject: Reply with quote

Voyager

Joined: 05 Jan 2012
Posts: 92

It's MQ7 and os is solaris
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Feb 17, 2012 5:43 am    Post subject: Reply with quote

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
View user's profile Send private message
riyaz_tak
PostPosted: Tue Feb 28, 2012 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message
JasonE
PostPosted: Tue Feb 28, 2012 5:48 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Most likely your client has not disconnected before it ends.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 28, 2012 5:54 am    Post subject: Reply with quote

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
View user's profile Send private message
riyaz_tak
PostPosted: Tue Feb 28, 2012 11:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Feb 28, 2012 11:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » AMQ9209: Connection to host 'localhost (127.0.0.1)' closed
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.