-Marko
> --
> You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
> To post to this group, send email to quar...@googlegroups.com.
> To unsubscribe from this group, send email to quartznet+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.
>
>
This did indeed occur in 1.0.2
I currently have 1 instance running in my cluster, soon to be 7.
The "IoCContainer" that I am using is just a tiny little class that stores the only the filename of the location for my castle Windsor configuration data. When serializing I only keep the filename, the actual Kernel/Container object is new'd when I deserialize the object so that the db is kept as small as possible.
I have attached a copy of the IoCContainer implementation for your review.
Stephen
-Marko
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4053
> --- End of inner exception stack trace ---
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4065
> at Quartz.Impl.AdoJobStore.JobStoreSupport.DoCheckin() in C:\Users
> \stunney\Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore
> \JobStoreSupport.cs:line 3669
> at Quartz.Impl.AdoJobStore.JobStoreSupport.ClusterManager.Manage()
> in C:\Users\stunney\Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Impl
> \AdoJobStore\JobStoreSupport.cs:line 4282 [See nested exception:
> System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The
> timeout period elapsed prior to completion of the operation or the
> server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserState
> Object
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
> stateObj)
> at
> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(By
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4053]
> 2010-08-24 12:43:41,500
> [Tsavo_DefaultQuartzJobScheduler_QuartzSchedulerThread] ERROR
> Quartz.Core.ErrorLogger [(null)] - An error occured while firing
> trigger 'DBWatchers.Trigger_SentryDBWatcher'
> Quartz.JobPersistenceException: Couldn't commit ADO.NET transaction.
> Timeout expired. The timeout period elapsed prior to completion of
> the operation or the server is not responding. --->
> System.Data.SqlClient.SqlException: Timeout expired. The timeout
> period elapsed prior to completion of the operation or the server is
> not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserState
> Object
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
> stateObj)
> at
> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(By
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4053
> --- End of inner exception stack trace ---
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4065
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock(Stri
> ng lockName, ITransactionCallback txCallback) in
> C:\Users\stunney\Desktop
> \Share\Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore
> \JobStoreSupport.cs:line 4242
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.TriggerFired(SchedulingContext
> ctxt, Trigger trigger) in C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 3250
> at Quartz.Core.QuartzSchedulerThread.Run() in C:\Users\stunney
> \Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Core
> \QuartzSchedulerThread.cs:line 388 [See nested exception:
> System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The
> timeout period elapsed prior to completion of the operation or the
> server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserState
> Object
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
> stateObj)
> at
> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(By
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
Also, I store the IIoCContainer implementation in the JobDetails of many (200+) jobs. I do find it strange though that this only ever happens to one trigger, and it is the first trigger created by my application on app startup (if it does not already exist).
The same job that was being placed into perpetual BLOCKED state is now in a perpetual ACQUIRED state. Again, it is a CRON, with a misfire instruction of 1 (SmartPolicy). I recently changed the JobDataMap to only contain strings (useProperties=true in my config), and all complex objects that I used to pass in through the datamap are now assigned to public properties in my job class in the JobToBeExecuted callback in a custom JobListener (dependency injection, yay!).
This CRON is set to fire every 2 minutes, reads from a very small database, and creates new quartz jobs based on the data it finds.
Just a heads up that the BLOCKED state is not the only condition for this.
Stephen
> > > _CONNECTI ON_STRING] = m_sqlServerConnectionString;
> > > jobDetail.JobDataMap[Job_SentryJobDatabaseWatcher.JOBDETAILS_EMAIL
> > > _NOTIFIER ] = m_emailer;
> > > jobDetail.JobDataMap[Job_SentryJobDatabaseWatcher.JOBDETAILS_LOGGE
> > > R] = m_logger;
> > > jobDetail.JobDataMap[Job_SentryJobDatabaseWatcher.JOBDETAIL_IOC_CO
> > > NTAINER]
--
* the actual job/trigger relations
- how many triggers per job type and job instance (instance = same
job name and group)
* job type
- are types in your cases IStatefulJobs?
* estimated/average job execution time per execution
If you have just one server in cluser (and hence not a cluster, you
could just use isClustered = false). Running stateful jobs with DB can
generally cause weird situations if running is locked from other
triggers and triggers run long and cause other triggers to wait (if
triggers' target is the same job definition).
Generally I would recommend against using stateful jobs with db if possible.
-Marko
You should just need to compile from trunk, configuration should work
as is. The interfaces have been generified so if you have lot of
references to IScheduler API there might be some work to get tests
run...
-Marko
What odd things are you seeing with the ADO jobstore and stateful jobs?
I'll try removing stateful job and see how it goes. This error happens every few hours, so it should be easy to see if it resolves the problem over the next couple of days.
Stephen
-----Original Message-----
From: quar...@googlegroups.com [mailto:quar...@googlegroups.com] On Behalf Of Marko Lahma
Sent: Wednesday, September 08, 2010 2:38 PM
To: quar...@googlegroups.com
-Marko
>> > > y _CONNECTI ON_STRING] = m_sqlServerConnectionString;
>> > > S tateObjec t stateObj, UInt32 error)
>> > > at
>> > > System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
>> > > asyncResult, TdsParserStateObject stateObj)
>> > > at
>> > > System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
>> > > at System.Data.SqlClient.TdsParserStateObject.ReadByte()
>> > > at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
>> > > SqlCommand cmdHandler, SqlDataReader dataStream,
>> > > BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
>> > > stateObj)
>> > > at
>> > > System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerReque
>> > > s t(Byte[] buffer, TransactionManagerRequestType request, String
>> > > transactionName, TransactionManagerIsolationLevel isoLevel, Int32
>> > > timeout, SqlInternalTransaction transaction, TdsParserStateObject
>> > > stateObj, Boolean isDelegateControlRequest)
>> > > at
>> > > System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction
>> > > Y ukon(Tran sactionRequest transactionRequest, String
>> > > transactionName, IsolationLevel iso, SqlInternalTransaction
>> > > internalTransaction, Boolean
>> > > isDelegateControlRequest)
>> > > at System.Data.SqlClient.SqlInternalTransaction.Commit()
>> > > at System.Data.SqlClient.SqlTransaction.Commit()
>> > > at
>> > > Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(Connecti
>> > > o nAndTrans actionHolder cth, Boolean openNewTransaction) in
-Marko
* SQL Server version?
* Do you create your own transactions in your jobs using
transactionscope or by other means?
* Are cluster nodes clocks synchronized?
* what happens if you increase the thread pool thread count, if you
now have two handling them?
I'm sure there are people on the list running clustered setups without
problems, if so please chime in that I don't get too paranoid :)
Blake: Unhandled exceptions are handled with forced no-retry police,
proceeding with standard scheduling. If you catch exceptions in your
jobs and rethrow as JobExecutionException (as you should) you can give
details about what to do (refire instructions).
-Marko
I tried increasing the thread pool count from 2 to 6, and the behaviour stayed the same.
On a side note, removing IStatefulJob and turning off clustering seems to have eliminated the problem, I will let you know for sure sometime tomorrow after reviewing the logs and checking the state of the quartz database.
Stephen
----- Original Message -----
From: quar...@googlegroups.com <quar...@googlegroups.com>
To: quar...@googlegroups.com <quar...@googlegroups.com>
-Marko
My job polls a separate set of tables for data that helps define how new jobs will be scheduled in quartz. But I never directly access the quartz tables ever. I only ever use the Quartz API for checking for the existence of triggers, jobs, and calendars.
And yes, six threads in my pool, all triggers are relatively simple Cron triggers of varying types (most run every 2, 5, 15 minutes every hour, every day). And I'd say most of the jobs finish in under 5 seconds, yes.
-----Original Message-----
From: quar...@googlegroups.com [mailto:quar...@googlegroups.com] On Behalf Of Marko Lahma
Sent: Monday, September 13, 2010 12:55 PM
To: quar...@googlegroups.com
-Marko
> Quartz.Impl.AdoJobStore.JobStoreSupport.RollbackConnection(ConnectionA
> ndTransactionHolder
> cth) in
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4053
> --- End of inner exception stack trace ---
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
> C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 4065
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock(Stri
> ng lockName, ITransactionCallback txCallback) in
> C:\Users\stunney\Desktop
> \Share\Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore
> \JobStoreSupport.cs:line 4242
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.AcquireNextTrigger(SchedulingC
> ontext ctxt, DateTime noLaterThan) in C:\Users\stunney\Desktop\Share
> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
> 3114
> at Quartz.Core.QuartzSchedulerThread.Run() in C:\Users\stunney
> \Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Core
> \QuartzSchedulerThread.cs:line 286 [See nested exception:
> System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The
> timeout period elapsed prior to completion of the operation or the
> server is not responding.
> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection)
> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
> at
> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserState
> Object
> stateObj, UInt32 error)
> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
> asyncResult, TdsParserStateObject stateObj)
> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream,
> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
> stateObj)
> at
> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(By
> te[] buffer, TransactionManagerRequestType request, String
> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
> timeout, SqlInternalTransaction transaction, TdsParserStateObject
> stateObj, Boolean isDelegateControlRequest)
> at
> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon
> (TransactionRequest transactionRequest, String transactionName,
> IsolationLevel iso, SqlInternalTransaction internalTransaction,
> Boolean
> isDelegateControlRequest)
> at System.Data.SqlClient.SqlInternalTransaction.Commit()
> at System.Data.SqlClient.SqlTransaction.Commit()
> at
> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAnd
> TransactionHolder cth, Boolean openNewTransaction) in
Because ADO.NET connection can be reset by SQL Server due to network
error and thus creating the error in the log about not being able to
rollback or commit.
-Marko
-Marko
>> Quartz.Impl.AdoJobStore.JobStoreSupport.RollbackConnection(Connection
>> A
>> ndTransactionHolder
>> cth) in
>> y te[] buffer, TransactionManagerRequestType request, String
>> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
>> timeout, SqlInternalTransaction transaction, TdsParserStateObject
>> stateObj, Boolean isDelegateControlRequest)
>> at
>> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYuko
>> n (TransactionRequest transactionRequest, String transactionName,
>> IsolationLevel iso, SqlInternalTransaction internalTransaction,
>> Boolean
>> isDelegateControlRequest)
>> at System.Data.SqlClient.SqlInternalTransaction.Commit()
>> at System.Data.SqlClient.SqlTransaction.Commit()
>> at
>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAn
>> d TransactionHolder cth, Boolean openNewTransaction) in
>> C:\Users\stunney\Desktop\Share
>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
>> 4053
>> --- End of inner exception stack trace ---
>> at
>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAn
>> d TransactionHolder cth, Boolean openNewTransaction) in
>> C:\Users\stunney\Desktop\Share
>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
>> 4065
>> at
>> Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock(Str
>> i ng lockName, ITransactionCallback txCallback) in
>> C:\Users\stunney\Desktop
>> \Share\Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore
>> \JobStoreSupport.cs:line 4242
>> at
>> Quartz.Impl.AdoJobStore.JobStoreSupport.AcquireNextTrigger(Scheduling
>> C ontext ctxt, DateTime noLaterThan) in
>> C:\Users\stunney\Desktop\Share
>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:line
>> 3114
>> at Quartz.Core.QuartzSchedulerThread.Run() in C:\Users\stunney
>> \Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Core
>> \QuartzSchedulerThread.cs:line 286 [See nested exception:
>> System.Data.SqlClient.SqlException (0x80131904): Timeout expired.
>> The timeout period elapsed prior to completion of the operation or
>> the server is not responding.
>> at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
>> exception, Boolean breakConnection)
>> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
>> at
>> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStat
>> e
>> Object
>> stateObj, UInt32 error)
>> at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
>> asyncResult, TdsParserStateObject stateObj)
>> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
>> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
>> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
>> SqlCommand cmdHandler, SqlDataReader dataStream,
>> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
>> stateObj)
>> at
>> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(B
>> y te[] buffer, TransactionManagerRequestType request, String
>> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
>> timeout, SqlInternalTransaction transaction, TdsParserStateObject
>> stateObj, Boolean isDelegateControlRequest)
>> at
>> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYuko
>> n (TransactionRequest transactionRequest, String transactionName,
>> IsolationLevel iso, SqlInternalTransaction internalTransaction,
>> Boolean
>> isDelegateControlRequest)
>> at System.Data.SqlClient.SqlInternalTransaction.Commit()
>> at System.Data.SqlClient.SqlTransaction.Commit()
>> at
>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionAn
>> d TransactionHolder cth, Boolean openNewTransaction) in
>>> > 5 0_ClusterManager] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - ClusterManager:
>>> > Check-in complete.
>>> > 2010-09-10 01:48:28,711
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_ClusterManager] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - ClusterManager:
>>> > Check-in complete.
>>> > 2010-09-10 01:48:47,211
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_ClusterManager] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - ClusterManager:
>>> > Check-in complete.
>>> > 2010-09-10 01:49:08,429
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_ClusterManager] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - ClusterManager:
>>> > Check-in complete.
>>> > 2010-09-10 01:49:13,711
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_ClusterManager] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - ClusterManager:
>>> > Check-in complete.
>>> > 2010-09-10 01:49:16,586
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_MisfireHandler] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - MisfireHandler:
>>> > scanning for misfires...
>>> > 2010-09-10 01:49:16,586
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_MisfireHandler] DEBUG Quartz.Impl.AdoJobStore.JobStoreTX
>>> > [(null)] - Found 0 triggers that missed their scheduled fire-time.
>>> > 2010-09-10 01:49:48,711
>>> > [QuartzScheduler_Sentry_DefaultQuartzJobScheduler-6341963898625787
>>> > 5 0_ClusterManager] ERROR Quartz.Impl.AdoJobStore.JobStoreTX
-Marko
Here's the link to the trial : http://www.red-gate.com/products/ants_performance_profiler/
Cheers
Mark
Mark Jones
SharePoint Solutions Architect - Collaboris Ltd
www.collaboris.co.uk
This message is intended only for the use of the person(s) ("the intended recipient(s)") to whom it is addressed. It may contain information which is privileged and confidential within the meaning of applicable law. If you are not the intended recipient, please contact the sender as soon as possible. The views expressed in this communication may not necessarily be the views held by The Company.
-Marko
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.RollbackConnection(Connectio
>>> n
>>> A
>>> ndTransactionHolder
>>> B y te[] buffer, TransactionManagerRequestType request, String
>>> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
>>> timeout, SqlInternalTransaction transaction, TdsParserStateObject
>>> stateObj, Boolean isDelegateControlRequest)
>>> at
>>> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYuk
>>> o n (TransactionRequest transactionRequest, String transactionName,
>>> IsolationLevel iso, SqlInternalTransaction internalTransaction,
>>> Boolean
>>> isDelegateControlRequest)
>>> at System.Data.SqlClient.SqlInternalTransaction.Commit()
>>> at System.Data.SqlClient.SqlTransaction.Commit()
>>> at
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionA
>>> n d TransactionHolder cth, Boolean openNewTransaction) in
>>> C:\Users\stunney\Desktop\Share
>>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:lin
>>> e
>>> 4053
>>> --- End of inner exception stack trace ---
>>> at
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionA
>>> n d TransactionHolder cth, Boolean openNewTransaction) in
>>> C:\Users\stunney\Desktop\Share
>>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:lin
>>> e
>>> 4065
>>> at
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock(St
>>> r i ng lockName, ITransactionCallback txCallback) in
>>> C:\Users\stunney\Desktop
>>> \Share\Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore
>>> \JobStoreSupport.cs:line 4242
>>> at
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.AcquireNextTrigger(Schedulin
>>> g C ontext ctxt, DateTime noLaterThan) in
>>> C:\Users\stunney\Desktop\Share
>>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:lin
>>> e
>>> 3114
>>> at Quartz.Core.QuartzSchedulerThread.Run() in C:\Users\stunney
>>> \Desktop\Share\Quartz.NET-1.0.3\src\Quartz\Core
>>> \QuartzSchedulerThread.cs:line 286 [See nested exception:
>>> System.Data.SqlClient.SqlException (0x80131904): Timeout expired.
>>> The timeout period elapsed prior to completion of the operation or
>>> the server is not responding.
>>> at
>>> System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
>>> exception, Boolean breakConnection)
>>> at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
>>> at
>>> System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserSta
>>> t
>>> e
>>> Object
>>> stateObj, UInt32 error)
>>> at
>>> System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult
>>> asyncResult, TdsParserStateObject stateObj)
>>> at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
>>> at System.Data.SqlClient.TdsParserStateObject.ReadByte()
>>> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
>>> SqlCommand cmdHandler, SqlDataReader dataStream,
>>> BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
>>> stateObj)
>>> at
>>> System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(
>>> B y te[] buffer, TransactionManagerRequestType request, String
>>> transactionName, TransactionManagerIsolationLevel isoLevel, Int32
>>> timeout, SqlInternalTransaction transaction, TdsParserStateObject
>>> stateObj, Boolean isDelegateControlRequest)
>>> at
>>> System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYuk
>>> o n (TransactionRequest transactionRequest, String transactionName,
>>> IsolationLevel iso, SqlInternalTransaction internalTransaction,
>>> Boolean
>>> isDelegateControlRequest)
>>> at System.Data.SqlClient.SqlInternalTransaction.Commit()
>>> at System.Data.SqlClient.SqlTransaction.Commit()
>>> at
>>> Quartz.Impl.AdoJobStore.JobStoreSupport.CommitConnection(ConnectionA
>>> n d TransactionHolder cth, Boolean openNewTransaction) in
>>> C:\Users\stunney\Desktop\Share
>>> \Quartz.NET-1.0.3\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:lin
>>> e
Lloyd,
What changes did you make on your side? Was it OS, Network, SQLServer (What version of each are you running)?
Inquiring minds want to know!
Stephen
As a software vendor I would strongly recommend checking the hardware ;)
Jokes aside, this definitely is an area where robustness should be
improved on Quartz's side.
-Marko
Marko, does the patch look acceptable to you?
Hey Lloyd,
I’m not sure the changes you made will actually work now. I needed to have the Trigger be an out param because when the exception is thrown in the first try, nextTrigger will ALWAYS be null (because the exception is thrown within the ExecuteInNonManagedTXLock(…) and hence the assignment of nextTrigger will not take place), and the check inside of the outer catch will never try and release the acquired trigger.
Also, the ExecuteInNonManagedTXLock(…) method I supplied was not meant to replace, but simply overload/compliment the one that already exists, so that I don’t modify any other functionality in the code base.
Believe me, I know the code isn’t elegant :) But it was the best stop-gap I could come up with.
Thanks guys for your insight, I really appreciate it. Lets try to
find out what's going on here!
-Marko
This is just a guess and I'm afraid that not a good solution as it
would indicate that your setup could take *a lot* of time trying to
find next trigger. If I understand correctly you don't have that many
triggers to handle. If you'd have many then the indexes described in
the FAQ would come handy to ensure timely updates and retrieval.
-Marko
DateTime acquireStart = DateTime.UtcNow;
do
{
try
{
Trigger nextTrigger = null;
IList keys = Delegate.SelectTriggerToAcquire(conn,
noLaterThan, MisfireTime);
// No trigger is ready to fire yet.
if (keys == null || keys.Count == 0)
{
return null;
}
foreach (Key triggerKey in keys)
{
int rowsUpdated =
Delegate.UpdateTriggerStateFromOtherState(
conn,
triggerKey.Name, triggerKey.Group,
StateAcquired, StateWaiting);
// If our trigger was no longer in the
expected state, try a new one.
if (rowsUpdated <= 0)
{
continue;
}
nextTrigger = RetrieveTrigger(conn, ctxt,
triggerKey.Name, triggerKey.Group);
// If our trigger is no longer available, try a new one.
if (nextTrigger == null)
{
continue;
}
break;
}
// if we didn't end up with a trigger to fire from
that first
// batch, try again for another batch
if (nextTrigger == null)
{
continue;
}
nextTrigger.FireInstanceId = FiredTriggerRecordId;
Delegate.InsertFiredTrigger(conn, nextTrigger,
StateAcquired, null);
return nextTrigger;
}
catch (Exception e)
{
throw new JobPersistenceException(
"Couldn't acquire next trigger: " + e.Message, e);
}
} while (DateTime.UtcNow - acquireStart < TimeSpan.FromSeconds(20));
return null;
Having multiple threads makes this a supreme headache to test. I'm just glad I caught the symptom :) Now to cure the cold!
-----Original Message-----
From: quar...@googlegroups.com [mailto:quar...@googlegroups.com] On Behalf Of Marko Lahma
Sent: Wednesday, September 22, 2010 1:37 PM
To: quar...@googlegroups.com
Subject: Re: [quartznet:2082] Re: 1.0.3.3 - Trigger getting stuck in BLOCKED State
The most troubling thing here that I see is that we get exception, we
try to rollback but still get committed data in DB. So without
successful commit (whether it is timeout or whatnot) we get data
committed to DB. I need to dig deeper and try to find what's the catch
here.. The patches you propose try to handle rollback of changes that
should not exist (yes, they do exist). Or this is just my analysis..
Thanks guys for your insight, I really appreciate it. Lets try to
find out what's going on here!
-Marko
On Wed, Sep 22, 2010 at 8:23 PM, Stephen Tunney <STu...@tsavo.com> wrote:
> Hey Lloyd,
>
>
>
> I'm not sure the changes you made will actually work now. I needed to have
> the Trigger be an out param because when the exception is thrown in the
> first try, nextTrigger will ALWAYS be null (because the exception is thrown
> within the ExecuteInNonManagedTXLock(...) and hence the assignment of
> nextTrigger will not take place), and the check inside of the outer catch
> will never try and release the acquired trigger.
>
> Also, the ExecuteInNonManagedTXLock(...) method I supplied was not meant to
Stephen
-Marko
return null;
>> within the ExecuteInNonManagedTXLock(...) and hence the assignment of
>> nextTrigger will not take place), and the check inside of the outer catch
>> will never try and release the acquired trigger.
>>
>> Also, the ExecuteInNonManagedTXLock(...) method I supplied was not meant to
The connection-transaction pair is opened per operation and stored
only in call tree (stack) so there shouldn't be any shared resource
conflicts. I suspect this to be some SQL Server edge case. One option
would be to use SET XACT_ABORT ON before every statement. What I
understand from the documentation is that SQL Server may commit
transaction if "no serious" error occurs. This would mean that you can
acquire a trigger and get a "non-fatal" error that would throw Quartz
of track (catch-block) and lose handle to the trigger that was ought
to be processed.
I still think that these might be symptoms to some other problem
though. Do you have the indexes created for the tables?
-Marko