• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Programmatically-created scheduled task fired off 3x in the same millisecond before erroring out

New Here ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

The task is created when a page is manually loaded via a ColdFusion page. We've used the same process for about a year now without incident (and I can't repeat the error now...). The code also checks a database field to make sure the email hasn't already been sent - it got through that as well somehow.

Here are the logs (I assume the ordering here is off since it all happened at the exact same time). It looks like it fired off 3x before it got the "Unable to store Job" error:

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-1] - Task DEFAULT.Blaster triggered.

Jul 23, 2015 12:03:58 PM Error [ajp-bio-8012-exec-1] - Unable to store Job : 'SERVERSCHEDULETASK#$%^DEFAULT.BLASTER', because one already exists with this identification.

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-1] - Starting HTTP request {URL='http://localhost:80/emailcampaigns/email.cfm?sendemails=true&RequestTimeout=90', method='get'}

Jul 23, 2015 12:03:58 PM Error [ajp-bio-8012-exec-1] - Unable to store Job : 'SERVERSCHEDULETASK#$%^DEFAULT.BLASTER', because one already exists with this identification. The specific sequence of files included or processed is: C:\cf10\wwwroot\emailCampaigns\email.cfm, line: 10

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-4] - Task DEFAULT.Blaster triggered.

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-3] - Task DEFAULT.Blaster triggered.

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-4] - Starting HTTP request {URL='http://localhost:80/emailcampaigns/email.cfm?sendemails=true&RequestTimeout=90', method='get'}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-3] - Starting HTTP request {URL='http://localhost:80/emailcampaigns/email.cfm?sendemails=true&RequestTimeout=90', method='get'}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-5] - Task DEFAULT.Blaster triggered.

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-5] - Starting HTTP request {URL='http://localhost:80/emailcampaigns/email.cfm?sendemails=true&RequestTimeout=90', method='get'}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-3] - HTTP request completed  {Status Code=200 ,Time taken=110 ms}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-4] - HTTP request completed  {Status Code=200 ,Time taken=110 ms}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-1] - HTTP request completed  {Status Code=200 ,Time taken=296 ms}

Jul 23, 2015 12:03:58 PM Information [DefaultQuartzScheduler_Worker-5] - HTTP request completed  {Status Code=200 ,Time taken=78 ms}

And here is the triggering code:

<cfif NOT IsDefined("url.sendemails")>

  <cfschedule

      action="update"

      task="Blaster"

      interval="300"

      operation="HTTPRequest"

      requestTimeOut="90"

      resolveURL="no"

      startDate="#DateFormat(Now())#"

      startTime="#TimeFormat(Now())#"

      url="http://localhost/emailcampaigns/email.cfm?sendemails=true">

<cfelse>

     ... loop over list from db and send emails to users without the sent date field filled in ...

    ... fill in the sent date after the email is sent ...

</cfif>

I only loaded the triggering page once, and even if I did load it multiple times, it shouldn't be able to create a task by the same name. And even then, I'm not sure how it defeated the database field check (I assume it happened so fast that the field wasn't written to yet?). The only thing I can think to do is lock the database table for reads and writes, which I guess I should be doing anyway. I have no confidence in this process now.


We're using

- CF 10 Standard

- MySQL 5.6.23

- Windows Server 2008R2

Any ideas?

Thanks,

Dave

Views

403

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2015 Sep 08, 2015

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation