Join wMUsers | Blog at wMUsers | Edit my wMUsers Profile | Site Map | webMethods Jobs |For Employers

wMUsers  
  #1  
Old 02-01-2010, 01:30
sam1234 sam1234 is offline
Member
 
Join Date: Jul 2009
Posts: 80
Thanks: 0
Thanked 1 Time in 1 Post
Thumbs up Service lock

Hi All,

Created a service which went in infinite loop because of coding issue, so i stopped the service in developer (but not yet killed, verified in IS service usage page). And modified the code again to avoid the infinite loop and ran the service but this time also service keeps running in developer also verified in service usage page. Why is that? I modified the code to avoid the infinite loop.

After server restart, without changing the code I ran service, this time it went fine since I modified before restart.

From this I understood, if we run a service which is running in infinite loop already, new service also goes into infinite loop, why is that? Correct me if am wrong? anyway to fix this? Can we say its a bug in webMethods?

Regards,
Sam.
Reply With Quote
Advertisement
  #2  
Old 02-01-2010, 06:19
griffima's Avatar
griffima griffima is offline
Senior Member
 
Join Date: Jun 2004
Posts: 725
Thanks: 1
Thanked 35 Times in 31 Posts
Default

Quote:
Can we say its a bug in webMethods?
Interesting perspective. No I wouldn't say that's a bug in webMethods IS. I think you first comment -
Quote:
because of coding issue
is a better thing to call it.

Quote:
o i stopped the service in developer (but not yet killed, verified in IS service usage page)
Restarting the IS service as you did is the correct way to clear out the bad thread. You can't really kill it while it's running and simply saving a new version of the service is not going to cause Java to unload a running thread, do garbage collection to remove references to the old stuff, load the new thread and execute.

We have all done this, no big deal in dev process. Just restart the IS process and continue on. No bug though.
__________________
markg

http://www.thegreylines.net
Reply With Quote
  #3  
Old 02-01-2010, 07:09
sam1234 sam1234 is offline
Member
 
Join Date: Jul 2009
Posts: 80
Thanks: 0
Thanked 1 Time in 1 Post
Thumbs up

Hi Mark,

Thanks for your reply.

Consider that, service running in infinite loop because of wrong code & now I modified the code to avoid the infinite loop and re-run the service, does the service goes into infinite? now.

Note*: I didn't kill the service which is in infinite loop[this is the code before modification & didn't restart the IS].

Regards,
Sam
Reply With Quote
  #4  
Old 02-01-2010, 07:33
griffima's Avatar
griffima griffima is offline
Senior Member
 
Join Date: Jun 2004
Posts: 725
Thanks: 1
Thanked 35 Times in 31 Posts
Default

Quote:
Consider that, service running in infinite loop because of wrong code & now I modified the code to avoid the infinite loop and re-run the service, does the service goes into infinite? now.

Note*: I didn't kill the service which is in infinite loop[this is the code before modification & didn't restart the IS].
Sam,
I understand what you are doing but as I said you really can't get rid of the active thread running in the JVM without restarting the IS process. That's really not a webMethods IS issue, it's more of a Java thing. Loading and unloading flow services and/or packages while they are currently executing is never a good thing either. webMethods IS will attempt to quiesce the service/package and associated active stuff but that's not advisable either. That's one reason you don't deploy code to prod during active cycles.

Even if you were able to save the new flow service and get it to load and execute correctly you would still have the hung thread that is in an infinite loop running on your IS server. Best bet is to just restart your service. Also keep in mind that if you have flow service that is being fed by a broker trigger, simply restarting the IS process will not be enough to kill it. It will continue on startup of the IS process if the message is not marked volatile.
__________________
markg

http://www.thegreylines.net
Reply With Quote
  #5  
Old 02-01-2010, 08:58
sam1234 sam1234 is offline
Member
 
Join Date: Jul 2009
Posts: 80
Thanks: 0
Thanked 1 Time in 1 Post
Smile

Hi Mark,

Hope I didn't tell you clearly....

[
Consider that, service running in infinite loop because of wrong code & now I modified the code to avoid the infinite loop and re-run the service, does the service goes into infinite? now.

Note*: I didn't kill the service which is in infinite loop[this is the code before modification & didn't restart the IS].

]
Here, first service will be infinite loop until we do restart IS. No doubt in that... But, how about the service (i.e. the 2'nd service. The service which executed after modification/correction of the infinite loop code) whether this 2'nd service too goes into infinite loop? because of the 1'st service which is in infinite loop.... Hope, now am clear in query....

Regards,
Sam
Reply With Quote
  #6  
Old 02-01-2010, 09:06
reamon's Avatar
reamon reamon is offline
Premium Member
 
Join Date: Apr 2003
Posts: 4,806
Thanks: 62
Thanked 183 Times in 143 Posts
Default

The second version of the service was saved to disk but was not loaded into memory because IS/the JVM could not do so--the original version of the service was being used so it could not load the new and fixed version. Thus your run of the service the second time, ran using the original code--resulting in another thread in an infinite loop.

Your fixed service wasn't loaded into memory until the IS restart.
__________________
-Rob
http://reamon.squarespace.com
Reply With Quote
  #7  
Old 02-01-2010, 21:25
sam1234 sam1234 is offline
Member
 
Join Date: Jul 2009
Posts: 80
Thanks: 0
Thanked 1 Time in 1 Post
Default

Generally this shouldn't be the case. right? So, some issue in IS or JVM. So whats the solution for this? always restarting IS is not the correct remedy, not intentionally writing the code in infinite loop...

Regards,
Sam.
Reply With Quote
  #8  
Old 02-02-2010, 01:03
ajaynaina ajaynaina is offline
Member
 
Join Date: Sep 2005
Posts: 63
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you make changes to the code inside the loop or outside the loop? If changes are made outside loop to avoid infinite loop, it is not going to help as thread scope is currently within the loop. However if you have made chagnes inside loop to come out of infinite loop then it should help after saving the code.
Reply With Quote
  #9  
Old 02-02-2010, 05:12
mwroblinski mwroblinski is offline
Member
 
Join Date: Jun 2008
Posts: 63
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi,

IS and JVM are working as expected here, although sometimes I also wish for the possibility to kill threads in IS. There are some approaches using Java code, but I've seen no reliable method so far. There is an entry on brainstorm which has staus planned, so this may come in the future.

However for your problem here Rob already pointed the important things out:

- Correct your code to avoid infinite loops
- Restart the IS JVM

Restarting IS may not be enough, so you should go for a complete stop of the underlying JVM.

Killing the IS JVM is the only reliable way so far to kill services which do not end themselfs.

One final note: Even if it would be possible to stop running services those should not go to infinite loops, this should be prevented by the code itself.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Null able inputs for Flow service based on JDBC service dexterz Flow and Java services 4 04-08-2009 11:08
problem loading WmRoot package arrkian Managing webMethods Integration Server 6 06-14-2007 20:20
Integration server is shutting down after every 30 minutes christinataylor Flow and Java services 4 12-20-2005 11:42
Service Holds forcing waits until other services complete alasko Flow and Java services 2 05-03-2004 01:37
Error starting WM server srobinson Managing webMethods Integration Server 4 05-14-2003 06:27


All times are GMT -6. The time now is 20:44.


.
All Content Copyright ©2002-2009, Conneva, Inc. DBA wMUsers.Com

wMUsers is an independent organization and is not sponsored in any manner by Software AG or webMethods, Inc.

Page generated in 0.10072 seconds with 16 queries