views:

1553

answers:

2

I have a timer job which has been deployed to a server with multiple Web front ends.

  • This timer job reads it's configuration from a Hierarchical Object Store.
  • This timer job is scheduled to run daily on the server.

But the problem is that this timer job is not getting invoked daily. I have implemented event logging in the timer job's Execute() method, but I dont see any logs being generated.

  • Any ideas as to what could cause a timer job to be not picked up for execution by the SharePoint Timer Service? How can I troubleshoot this problem?

  • Are there any "gotcha"s for running timer jobs in servers from multiple front ends? Will the timer job get execute in all the web front ends, or any one of them arbitarily? How to know which machine will have my event logs?

  • This might be a stupid question, but does having multiple front ends for load balancing affect the way Hierarchical Object Stores behave?

EDIT:

One of the commenters, Sean McDounough, (Thanks Sean!! ) made a very good point that:

"whether or not the timer job runs on all WFEs will be a function of the SPJobLockType enum value you specified in the constructor. Using a value of "None" means that the job will run on all WFEs."

Now, my timer job is responsible for sending periodic mails to a list of users. Currently it is marked as SPJobLockType.Job"

  • If I change this to SPJobLockType.None, does this mean that my timer job will be executed in all the WFEs separately? (THis is not desired, it will spam all the users with multiple emails)

  • Or does it mean that the timer job will execute in any one of the WFEs, arbitarily?

+4  A: 

Try restarting the SharePoint timer service from the command-line using NET STOP SPTIMERV3 followed by a NET START SPTIMERV3. My guess is that the timer service is running with an older version of your .NET assembly. The timer service does not automatically reload assemblies when you upgrade the WSP solution.

Lars Fastrup
Excellent point by Lars, and one that commonly catches developers (both new and seasoned) who work with the timer service. One additional point of note for you, ashwnacharya: whether or not the timer job runs on all WFEs will be a function of the SPJobLockType enum value you specified in the constructor. Using a value of "None" means that the job will run on all WFEs. A value of "Job," however, means that it'll run on only one server -- the one on which you submitted the job (unless you indicated a specific SPServer in your constructor).
Sean McDonough
I assune you had the TimerJopb running on your dev machine? If not, check out my question at http://stackoverflow.com/questions/985581/debugging-sharepoint-timer-jobs, to see if anything goes awry...
Colin
A: 

Do check out this link for help:

http://prasanjitmandal.blogspot.com/2010/06/sharepoint-timer-job-stuck-at-deploying.html