1.8.3 appears to have addressed this issue with a single application server. However, we're seeing the issues when load-balancing our application (multiple Tomcat servers).

I have verified that our Quartz config contains

org.quartz.jobStore.isClustered = true

The stack trace that we're seeing regularly is below. I'm working on getting a thread dump. 
Code:

2010-09-10 11:21:39,199 ERROR [ErrorLogger] : An error occured while firing trigger 'DEFAULT.Publish Request Check'
org.quartz.JobPersistenceException: Couldn't update states of blocked triggers: Lock wait timeout exceeded; try restarting transaction [See nested exception: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2925)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$38.execute(JobStoreSupport.java:2846)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3763)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2840)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:320)
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2022)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1940)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1925)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.updateTriggerStatesForJobFromOtherState(StdJDBCDelegate.java:1695)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2918)
... 4 more

Lock timeout exceptions aren't necessarily deadlocks, they could simply be true timeouts due to lock contention.

I see that you're using mysql. Make sure you have row-level locking enabled (and indexes on the tables). Also make sure that your setup is configured to use Read-Committed tx isolation level.

Thanks for the info. We are using InnoDB tables which use row-locking by default, as far as I know. There are definitely indexes on the table.

I just added: 
Code:

 org.quartz.jobStore.txIsolationLevelReadCommitted = true
 

to our quartz config and this seems to have made a significant difference. Previously I was getting those errors every few minutes without fail. So far, I haven't seen any.

Is this something you would recommend us doing for all of our supported db vendors or just MySQL? We support MySQL 4.1/5.0, SQL Server 2k5/2k8, and Oracle 10g.

Should we be using this setting in non-load-balanced environments as well?

原文:http://forums.terracotta.org/forums/posts/list/4051.page#22425

Quartz contention when running in load balanced environment--reference的更多相关文章

  1. 运行Vue项目,没办法自动打开浏览器,提示“Unable to open browser. If you are running in a headless environment, please do not use the open flag.”

    留坑,待解决 Unable to open browser. If you are running in a headless environment, please do not use the o ...

  2. 关于 IdentityServer 部署到生产环境相关问题踩坑记录

    Idsr 定义了几种模式适用于不同的场景: // // 摘要: // OpenID Connect flows. public enum Flows { // // 摘要: // authorizat ...

  3. WCF安全 z

    WCF custom authentication using ServiceCredentials The generally accepted way of authenticating a us ...

  4. Network Load Balancing Technical Overview--reference

    http://technet.microsoft.com/en-us/library/bb742455.aspx Abstract Network Load Balancing, a clusteri ...

  5. Load Balancing with NGINX 负载均衡算法

    Using nginx as HTTP load balancer Using nginx as HTTP load balancer http://nginx.org/en/docs/http/lo ...

  6. How to Configure Tomcat/JBoss and Apache HTTPD for Load Balancing and Failover

    http://java.dzone.com/articles/how-configure-tomcatjboss-and In this post we will see how to setup a ...

  7. Uniform synchronization between multiple kernels running on single computer systems

    The present invention allocates resources in a multi-operating system computing system, thereby avoi ...

  8. [摘录]quarts:Quartz Quick Start Guide

    (Primarily authored by Dafydd James) Welcome to the QuickStart guide for Quartz. As you read this gu ...

  9. How Network Load Balancing Technology Works--reference

    http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balan ...

随机推荐

  1. PHP~foreach遍历名单数组~有必要多次观看练习

  2. php生成缩略图

    <?php /** * 生成缩略图函数(支持图片格式:gif.jpeg.png和bmp) * @author ruxing.li * @param string $src 源图片路径 * @pa ...

  3. how to use a xml_id in field domain

    "[('parent_id','child_of', %(other_module.xml_id)d)]"

  4. java Active Object模式(上)

    Active Object模式简介 Active Object模式是一种异步编程模式.它通过对方法的调用与方法的执行进行解耦来提高并发性.若以任务的概念来说,Active Object模式的核心则是它 ...

  5. Webpack 傻瓜式指南(一)

    modules with dependencies   webpack   module bundler   static  assetss   .js .js .png Webpack傻瓜式指南 n ...

  6. Unity3D内存释放

    Unity3D内存释放 最近网友通过网站搜索Unity3D在手机及其他平台下占用内存太大. 这里写下关于Unity3D对于内存的管理与优化. Unity3D 里有两种动态加载机制:一个是Resourc ...

  7. H3C S5500上层接路由,VLAN IP作网站配置实例

    # version 5.20, Release 2208 # sysname S5500-1 # clock timezone #Web#8#01 add 08:00:00 # super passw ...

  8. c#:for循环;穷举,迭代 练习

    一)穷举 1. 第x种买法:羽毛球拍xx个,羽毛球xx个,水xx瓶 2. 单位给发了一张150元购物卡,拿着到超市买三类洗化用品.     洗发水15元,香皂2元,牙刷5元.求刚好花完150元,有多少 ...

  9. ♫【异步】短小强悍的JavaScript异步调用库

    短小强悍的JavaScript异步调用库 var queue = function(funcs, scope) { (function next() { if(funcs.length > 0) ...

  10. 【转】github如何删除一个仓库

    原文网址:http://jingyan.baidu.com/article/647f0115b031887f2048a85a.html?qq-pf-to=pcqq.group 今天打算删除一个仓库重新 ...