Question End Progress operation from bat file

wa4qms

Member
Good day all.
We have a batch file that runs from Window Task Scheduler, and runs every 15 minutes on a dedicated server.
What is now happening it appears that after 10 years, the 'process' is being left running.
Here is the current batch code.:
C:\Progress\OE111\bin\prowin32.exe -db xxx.db -H xxxxxxxx -S xxxx -U xxxxxxxxxxxxx -P xxx -n 4 -Ma 4 -rr -p C:\NxT\staging\rcode-s\supam\saonlineack_v2.r

exit
I am thinking that the prowin32.exe needs to be 'closed' to solve this new problem. But the possible issue is that others may be running a progress session as well.
And looking at the task manager I am thinking this "closure' function needs to be in the .p code .

The .p is complicated as it launches a Crystal Report. rpt file passing a number of parameters to create the report.
Does that make sense?
Dennis
 
No, it doesn't really make much sense.

First of all - what is the *problem*? A task not terminating isn't, necessarily, a problem. It might be annoying and unsightly but is there an actual problem like maybe some data doesn't get exported or a report doesn't get generated or some business process goes wrong...

If you do go ahead and terminate the process does it solve your problem? Or does it just happen again the next time the task runs?

What do you mean by "is being left running"?

Who is doing the leaving? "Left running" by whom? Or what action was supposed to transition it from running to not running? And why is that no longer happening? A scheduled task will launch a process but unless you go out of your way the task scheduler doesn't generally terminate those tasks. They usually run until some internal criteria is met and then they exit. Understanding that criteria could lead to understanding why it is not happening.

Or...

Are you saying that it is running longer than "usual" (which would imply that you have records showing what is "usual") or, perhaps, longer than "expected" (which implies that you have a length of time in mind). Or are you saying that it is never finishing (and that it used to finish and terminate cleanly)?

Do you have the source to saonlineack_v2? That sounds like custom code.

Even if you lack the source you can run "proGetStack <processid>" from a proenv command line and get a protrace.<processid> file which will contain a 4gl stack trace. That stack trace will tell you what line of code is being executed at the moment you run proGetStack. If your code is looping, or blocking on something (maybe someone has a record lock on something that you need), or just executing a massive out of control query you will know where to look for more insight. Or, if it is vendor code and you don't have the source, you can tell the vendor where to look.

Why are you worried that others may be running a Progress session? That shouldn't be a concern about terminating _this_ process. You said this is a dedicated server. So terminate interlopers with extreme prejudice. (Ok, that might be slightly anti-social, you could always give them a warning or two and then kill them...)

The more general concern about terminating a Windows process is that if the process being terminated is connected to the database via shared memory then there is a risk that killing it via task manager will crash the database. That will impact all users of that database. Not just users on that same Windows instance. If you are unsure if the process is using shared memory look for -S on the command line. You show a -S above so this process is NOT using shared memory and, therefore, killing this process is not risking a db crash.

Does this task create any logs that show any errors or which might provide any insight into what is happening? You might want to consider adding "-clientlog logfilename" to your process startup parameters if there is no current logging.

Beyond that, I have a few observations:

1) It is a headless batch job. It should not be prowin32, it should be _progres. Not that that has anything to do with the problem du jour. It just bugs me.

2) "OE111" suggests OpenEdge 11.1. Which aligns well with "after 10 years". Have either Windows or Crystal Report been upgraded or received service packs since this process was deployed? (I'm pretty sure that Windows is getting service packs more or less every week.) What is your excuse for running a woefully obsolescent release of OpenEdge and failing to apply service packs to that? I see NXT in your path so I'm guessing that this is an Infor SXE deployment. In spite of what first line tech support will always tell you - it *is* possible to upgrade OpenEdge. You just need to escalate a few layers. There *are* people at Infor who understand that upgrading OpenEdge is ok.
 
Last edited:
It is a headless batch job. It should not be prowin32, it should be _progres. Not that that has anything to do with the problem du jour. It just bugs me.

Why? Are there any significant differences between the executables or environments?

The OP's command line should use the -b switch, for sure.
 
Another observation... your startup command contains "-n 4 -Ma 4". Those are server startup parameters. They have no relevance to starting a client session.
 
Why?

It’s good for the soul.

Aside from that… yes, the executables are clearly different; why carry around all of that excess baggage? Batch jobs don’t need support for mice and GUIs and all of that useless cruft.
 
Thank for all the thoughts. I wrote the original code in the .p, and as I said, ran fine for more than 10 years. What is happening is best examiined in the Task Manager of the Windows server. But this may help more. We run both a windows version of progress and a UNIX version. The DB is on the UNIX box. The program that creates the reports has to be run from windows. (Crystal Reports). On the windows server, in the Schedule Task is the call to run the .bat file every 15 minutes, as the reporting function from InFor, while it will run the program, is unable to be set up on a schedule in their report manager. (Sx). So the now the .exe is left as a background process and for some reason their (as I am now a contractor) stays connected and it appears there are now limits to the number of connections.

A great example would be if you started multiple sessions of excel. If you do you will see more than one excel session in the task manager. When you would close one, the number would decrease. I verified this within Progress coding, and figured out in 2000 that 'com' handles were being left. A simple close handle took care of that problem.

As to upgrading there are two reason:
1. Most of the code that is being used are customized, and therefore upgrading SX is more than just a pain.
2. The company involved is moving away from Progress and does not want to spend any more money in a system that is being replaced.
3. New versions of Crystal Reports do not support the much older (BOXI) version of Progress passable commands. I wrote a program that loads the information into windows systems that allow these calls. It was posted here as a free program some years ago, and still works today. (RDC commands maybe???)

I will have to look up the information regarding the _progres option and see what is needed and if it works in this case. It did not occur to us that starting up a 'server' would be the issue. The Crystal Report uses ODBC to make the connection, so this might be the answer, and easy enough to test this weekend as the .bat file does not run on the weekends.

Thanks all and I'll keep you posted.
 
You don't need to upgrade SX in order to upgrade OpenEdge anymore than you need to upgrade SX before applying a Windows update.
 
"What is happening is best examiined in the Task Manager..." "...the .exe is left as a background process and for some reason their (as I am now a contractor) stays connected and it appears there are now limits to the number of connections."

So "the problem" is that each execution of the task (every 15 minutes) is failing to exit and that you eventually run out of connections to the database?

The problem before the problem seems to be: "is unable to be set up on a schedule in their report manager. (Sx)."

It seems like you need to determine *why* it is unable to do that and how the program is (mis)behaving once that happens.

1) Are there any log files that would report any errors or indicate what steps of the process are completing successfully?

2) Use proGetStack to obtain a stack trace and determine what the situation is with the jobs that are left running.

3) To capture any Progress errors that might not be being logged add "-clientlog logfilename.log"
 
Using _progres, or not, doesn't matter. That's just me being annoyed at the "when all you have is a hammer everything is a nail" approach. You could make me even more annoyed if you tell me that the source file is a .w. (Which also doesn't affect the outcome.)
 
Good morning all, and it appears that the issue had nothing to do with the .bat file and the settings being used. While we are still testing the theory, it appears that because of a corporate policy forcing both the local PC and the RDC connections to go into a 'sleep' mode, when reactivated a 'NEW' progress session is started if the PC goes into sleep mode while still connected. As an independent contractor, lots of time I will walk away leaving the session up to have lunch or something. For two days now the .bat has been running and NO left-over sessions showed up. One clue was that the program was prowin32, the same I use when writing code, and I've been offline for that since Friday night. So we think we have found the problem, but will continue to test this week, just to be sure. Thanks for all the suggestions.
-Dennis-
 
It appears that whatever was happening is no longer happening. (Is that not always the case!) We made no changes at all and suddenly the problem was gone. We had thought that some form of improper shut-down was causing it and tried to force every task we could to test the issue. Nothing. So again I apricate the help and just wish we had some answer.
-Dennis-
 
It is a headless batch job. It should not be prowin32, it should be _progres. Not that that has anything to do with the problem du jour. It just bugs me.
Why? Are there any significant differences between the executables or environments?
I have a vague recollection of a Progress runtime engineer saying that batch clients should use _progres.exe rather than a GUI client. I can't quote the particulars now. I believe it was more about efficiency rather than compatibility, as there are some cases where the two clients follow different code paths. There are some concepts, like child windows and fonts, that only exist in GUI.
 
Back
Top