Delay process bug

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Delay process bug

4D Tech mailing list
So, the Delay Process bug hit two servers within an hour of each other this morning, after months of not having the issue.  It was weird that both of them hit the bug this morning within a short period of time of each other.

This was on 16.3 HF2, so the latest and greatest...
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
> On 1/04/2018, at 7:00 am, Jeffrey Kain wrote:
> So, the Delay Process bug hit two servers within an hour of each other this morning, after months of not having the issue.  It was weird that both of them hit the bug this morning within a short period of time of each other.
> This was on 16.3 HF2, so the latest and greatest...

Hi all - this is just an FYI…
Using 4D v16.3 on Win, we have confirmed that a particular stored procedure (background tasks) running on “Client” will freeze whereas if it is run on the server it does not.
I’ve been away for a short while but hope to work with 4D soon to try to narrow down the cause.
Cheers, Keith
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Our server (macOS 10.11, 4D 16.3 HF3 64-bit) hit this bug again last week after being up for about 22 days. There are 2 separate processes that run periodically, both at the same time stopped waking from DELAY PROCESS. The Server window also was not showing the 4D username in the user list, although IP, machine name, and login date/time were displayed.

A watchdog process would have to run continuously to avoid being delayed at the time when delay timers die. Sucking up that much cpu just to try to be notified of a bug that occurs every few weeks doesn’t seem like a great solution. Also, because these methods use plugins and probably Begin/End SQL blocks, I can’t run them preemptively to see if preemptive threads have the same problem with DELAY PROCESS.

Jim Crate


> On Mar 31, 2018, at 8:31 AM, Jeffrey Kain via 4D_Tech <[hidden email]> wrote:
>
> So, the Delay Process bug hit two servers within an hour of each other this morning, after months of not having the issue.  It was weird that both of them hit the bug this morning within a short period of time of each other.
>
> This was on 16.3 HF2, so the latest and greatest...
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Delay process bug

4D Tech mailing list
> DELAY PROCESS never comes back

Be sure to submit a bug with 4D when this happens. I submitted one and they said if it isn't reproducible they "can't" fix it. If there is enough complaining about it, I hope they would spend time digging into it and realize it is a problem even if it can't be reproduced on demand.

Neil






--

Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
22 days does sound suspicious; as if (no proof),
the scheduler is testing if milliseconds "minus" process up-time is "greater than" delay time...
such logic would break when milliseconds expressed in signed 32-bit long integer flips to negative, after 24 days.
(milliseconds is counted since system boot, not 4D launch)

> 2018/06/13 4:43、Jim Crate via 4D_Tech <[hidden email]> のメール:
> Our server (macOS 10.11, 4D 16.3 HF3 64-bit) hit this bug again last week after being up for about 22 days.




**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
We just released a new version of our software a week and a half ago. In this version I added a palette window on the server which runs On Timer. I also added code to most every background process which updates some information every time it wakes up from a Delay Process call. The palette window checks this information and, if it sees a process that has been asleep longer than one minute, resumes the process and sends us a Slack message identifying the server and process that was asleep. If the process does not get resumed, another Slack message is sent so we can handle the issue manually before our customer knows.

Interestingly, this mechanism was triggered on Sunday morning at 1:01 AM for 9 servers. All 9 reported one or more stalled processes within a 60 second time period.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<[hidden email]>
<www.synergyfarmsolutions.com>


> On Jun 12, 2018, at 1:43 PM, Jim Crate via 4D_Tech <[hidden email]> wrote:
>
> Our server (macOS 10.11, 4D 16.3 HF3 64-bit) hit this bug again last week after being up for about 22 days. There are 2 separate processes that run periodically, both at the same time stopped waking from DELAY PROCESS. The Server window also was not showing the 4D username in the user list, although IP, machine name, and login date/time were displayed.

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
There have been enough reports that they know it happens on both macOS and Windows. Multiple reports indicate the processes can continue when RESUME PROCESS is called. In this case RESUME PROCESS would have worked, because when quitting the server, the processes started again because the quitting process resumes them. However, this bug will never be reproducible on demand. The only way this bug can be fixed is by 4D engineers looking into the code to figure out why sometimes processes delayed with DELAY PROCESS don’t wake up. None of us know what kind of mechanism or data structures they are using to track when delayed processes should wake up.

Sometimes, as programmers, we just have to take the customer reports of something happening and look through our code to see what can possibly trigger the condition. I have done that before and discovered the cause of non-reproducible bugs. I have also looked and not found code that could cause a condition the customer reported.

Jim Crate


> On Jun 12, 2018, at 1:27 PM, Dennis, Neil via 4D_Tech <[hidden email]> wrote:
>
>> DELAY PROCESS never comes back
>
> Be sure to submit a bug with 4D when this happens. I submitted one and they said if it isn't reproducible they "can't" fix it. If there is enough complaining about it, I hope they would spend time digging into it and realize it is a problem even if it can't be reproduced on demand.
>
> Neil
>
>
>
>
>
>
> --
>
> Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
> 32-bit long integer flips to negative, after 24 days.

You might be on to something 😊

Could pass this on to the 4D tech guys... there are several bugs already reported for this.

Neil



Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
That happened to me once in an earlier version of 4D. Long story short, DELAY PROCESS is meant for short-term scheduling, not long-term process management. Even so, it’s good to know in advance.

-- bag

Sent from my mobile

On Jun 12, 2018, at 13:57, Dennis, Neil via 4D_Tech <[hidden email]> wrote:

>> 32-bit long integer flips to negative, after 24 days.
>
> You might be on to something 😊
>
> Could pass this on to the 4D tech guys... there are several bugs already reported for this.
>
> Neil
>
>
>
> Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
I doublechecked the time the server was started until the last time the processes were delayed and it was actually 24.74 (2137700 seconds). The processes were delayed for 5 minutes. However, that time period + the delay is still 9,483,647 ms, or 2.63 hours, short of the 2147483647 max signed 32-bit integer.

Also many people have this occur after several months, so the DELAY PROCESS code must be able to accommodate the milliseconds rollover, at least in general. If it’s related to that, it must be an interesting corner case.

Jim Crate


> On Jun 12, 2018, at 1:33 PM, Keisuke Miyako via 4D_Tech <[hidden email]> wrote:
>
> 22 days does sound suspicious; as if (no proof),
> the scheduler is testing if milliseconds "minus" process up-time is "greater than" delay time...
> such logic would break when milliseconds expressed in signed 32-bit long integer flips to negative, after 24 days.
> (milliseconds is counted since system boot, not 4D launch)
>
>> 2018/06/13 4:43、Jim Crate via 4D_Tech <[hidden email]> のメール:
>> Our server (macOS 10.11, 4D 16.3 HF3 64-bit) hit this bug again last week after being up for about 22 days.
>
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
I’ve seen it happen in as little as a few hours of a machine restart or after it had been running for a >2 months. Same with when 4D Server itself was launched.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<[hidden email]>
<www.synergyfarmsolutions.com>


> On Jun 12, 2018, at 3:26 PM, Jim Crate via 4D_Tech <[hidden email]> wrote:
>
> Also many people have this occur after several months, so the DELAY PROCESS code must be able to accommodate the milliseconds rollover, at least in general. If it’s related to that, it must be an interesting corner case.

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
I also did some digging our servers are patched on a monthly bases and restarted. So usually restart is few days over the 24.74 days. We have only had one instance of the delay process bug. So most of the time, even if it is a 32 bit signed integer problem, we don't have an issue with the delay process except the one time.

Neil





Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Cannon Smith:

> We just released a new version of our software a week and a half ago. In this version I added a palette window on the server which runs On Timer. I also added code to most every background process which updates some information every time it wakes up from a Delay Process call. The palette window checks this information and, if it sees a process that has been asleep longer than one minute, resumes the process and sends us a Slack message identifying the server and process that was asleep. If the process does not get resumed, another Slack message is sent so we can handle the issue manually before our customer knows.
>
> Interestingly, this mechanism was triggered on Sunday morning at 1:01 AM for 9 servers. All 9 reported one or more stalled processes within a 60 second time period.


I also have a palette window that runs On Timer.
So the workaround for the Delay Process bug was quite simple over here.
I replaced Delay Process with Pause Process (which is what Delay Process does anyway when the bug bites).
In On Timer I call Resume Process.
Never had any problems since I did it that way.

(Still this is only a workaround and the bug should of course be fixed by 4D. Until it is fixed Delay Process is a command that should be avoided.)

Greetings from Germany,
Bernd Fröhlich
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Hi Jim,

Is there somehow PAUSE PROCESS/RESUME PROCESS involved?

I don't know if this has something to do with our issue, but I'd like to share a change in behavior (bug?) between v15 (and older) and v16 (and later).
Also struggling with a process not waking up after the delay time, I found pause process/resume process on a delayed process does not work as I would expect in 4D v16 and later.
Following scenario:

A process is running and is delayed for eg 1 minute. If the process is paused and resumed within that minute, the process won't wake up. Neiter immediately, neither after the delay time. Tested on Mac (v16 and 17 32/64). Another call to RESUME PROCESS will wake it immediately, another DELAY PROCESS will wake it after the new delay time.

This behavior is different in v15. This is what I do and what I see in the runtime explorer:
- start process: Executing
- delay process (3600 ticks): Delayed
- pause process (within the delay time): Delayed
- resume process (within the delay time): Executing

V16
- start process: Executing
- delay process (3600 ticks): Delayed
- pause process (within the delay time): Delayed
- resume process (within the delay time): Paused (!)

- resume process or delay process (0 ticks): Executing

I don't know what the standard behavior should be, but above is what I discovered. The work around is rather easy: when you want to resume a process, check if its status is paused or delayed. If paused: resume, if delayed: delay(0). Or don't use resume, but always use delay(0). Because a delayed or paused process will always wake up on delay(0).

HTH
Koen

> Op 12 jun. 2018, om 21:43 heeft Jim Crate via 4D_Tech <[hidden email]> het volgende geschreven:
>
> Our server (macOS 10.11, 4D 16.3 HF3 64-bit) hit this bug again last week after being up for about 22 days. There are 2 separate processes that run periodically, both at the same time stopped waking from DELAY PROCESS. The Server window also was not showing the 4D username in the user list, although IP, machine name, and login date/time were displayed.



--------------------
Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Knesselare
Belgium
tel +32 495 511.653

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
What does that mean? If you have a cron job process running on server that wakes every 5 minutes to check and launch other processes. Is that what you consider short term scheduling?

Regards

Chuck
------------------------------------------------------------------------------------------------
 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064      
 mailto:cjmiller<AT SIGN>informed-solutions.com
 Brookline, MA 02446 USA Registered 4D Developer                
       Providers of 4D and Sybase connectivity
          http://www.informed-solutions.com 
------------------------------------------------------------------------------------------------
This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law.  These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited.  Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication.

> On Jun 12, 2018, at 5:07 PM, Bryan Green via 4D_Tech <[hidden email]> wrote:
>
> That happened to me once in an earlier version of 4D. Long story short, DELAY PROCESS is meant for short-term scheduling, not long-term process management. Even so, it’s good to know in advance.
>
> -- bag

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
> On Jun 13, 2018, at 14:28, Chuck Miller via 4D_Tech <[hidden email]> wrote:
>
> What does that mean? If you have a cron job process running on server that wakes every 5 minutes to check and launch other processes. Is that what you consider short term scheduling?

Actually, that's exactly what I meant -- short-term (5 minutes, 10 minutes, etc.) kind of delay using DELAY PROCESS is more stable than something like 12 hours, 1 day, etc. using DELAY PROCESS.

You're in my head, Chuck!

-- bag


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Bryan Green:

> Actually, that's exactly what I meant -- short-term (5 minutes, 10 minutes, etc.) kind of delay using DELAY PROCESS is more stable than something like 12 hours, 1 day, etc. using DELAY PROCESS.

If by "more stable" you mean "hangs only every few weeks" that may be right.
I still would not use it at the moment.
Until it stopped beeing reliable I used it to delay a process by 10 seconds.

Greetings from Germany,
Bernd Fröhlich
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
I have never had an issue with DELAY PROCESS. Maybe I'm lucky. I don't
think I've ever used it to delay something more than a matter of seconds,
though. It would never have occurred to me to DELAY PROCESS for minutes or
hours.

If I have some process I only want one instance of, maybe processing
records created by imports from various, simultaneous sources, I use this
outline:

// UniqueProcessMethod (some parameter)
$processName:=Current method name
Case of

:(Count parameters=1)

$pid:=Process number($processName)

If($pid=0)  // process doesn't exist

$pid:=EXECUTE ON SERVER(Current method name; 1024*1024; $processName;
$1;Current process)

End if

:(Count parameters=2)

//  do whatever here

End case


This works consistently if called from a client process or server process.
I prefer making $1 an object but the approach works just as well if you
have more than one parameter. The key is adding the current process
(sometimes useful) to distinguish between the call to start the process and
just checking data.

The other tool I have for such situations is a really simple stored method
launcher. It requires 1 table, a background loop (which delays 1 minute)
and the idea is to create a record for each method that I want to run at
some interval. I'm sure a lot of you already have such a thing in place.
This is what I use in place of long delays. Like for daily reports or
maintenance methods.

On Fri, Jun 15, 2018 at 12:04 AM Bernd Fröhlich via 4D_Tech <
[hidden email]> wrote:

> Bryan Green:
>
> > Actually, that's exactly what I meant -- short-term (5 minutes, 10
> minutes, etc.) kind of delay using DELAY PROCESS is more stable than
> something like 12 hours, 1 day, etc. using DELAY PROCESS.
>
> If by "more stable" you mean "hangs only every few weeks" that may be
> right.
> I still would not use it at the moment.
> Until it stopped beeing reliable I used it to delay a process by 10
> seconds.
>
> Greetings from Germany,
> Bernd Fröhlich
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************



--
Kirk Brooks
San Francisco, CA
=======================

*We go vote - they go home*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
On 16 Jun 2018, at 12:20 am, Kirk Brooks via 4D_Tech <[hidden email]> wrote:
>
> I have never had an issue with DELAY PROCESS. Maybe I'm lucky. I don't
> think I've ever used it to delay something more than a matter of seconds,
> though. It would never have occurred to me to DELAY PROCESS for minutes or
> hours.

<snip>

> The other tool I have for such situations is a really simple stored method
> launcher. It requires 1 table, a background loop (which delays 1 minute)
> and the idea is to create a record for each method that I want to run at
> some interval.

Hi Kirk

Just curious... how do you delay your background loop for a minute without using DELAY PROCESS? If you're using it for this then you'll be potentially affected by this bug and, as you pointed out, just lucky it hasn't bitten you yet.

J
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Delay process bug

4D Tech mailing list
according to the bug description for ACI0098368 ("Delayed processes do not wake up if paused/resumed while already delayed"),

it's not that the DELAY P. has a problem resuming,
the problem manifests itself when the codes pauses a process that is already in "delay" status.
a double resume is required to cancel a delay-double combo.

> In v16 the runtime explorer shows the following:
>
> - start process: Executing
> - delay process (3600 ticks): Delayed
> - pause process (within the delay time): Delayed
> - resume process (within the delay time): Paused (!)
> - resume process or delay process (0 ticks): Executing
>
> So in v16, there is an additional RESUME PROCESS that is required to kick the process back into gear.

so as long as you use pause & resume, or delay (with no interference), everything should be OK.

but mixing delay, pause, resume in a complex sequence could mean trouble.
the good news is that the bug described above is on course to be fixed.



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
12