Quartz contention when running in load balanced environment--reference
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的更多相关文章
- 运行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 ...
- 关于 IdentityServer 部署到生产环境相关问题踩坑记录
Idsr 定义了几种模式适用于不同的场景: // // 摘要: // OpenID Connect flows. public enum Flows { // // 摘要: // authorizat ...
- WCF安全 z
WCF custom authentication using ServiceCredentials The generally accepted way of authenticating a us ...
- Network Load Balancing Technical Overview--reference
http://technet.microsoft.com/en-us/library/bb742455.aspx Abstract Network Load Balancing, a clusteri ...
- Load Balancing with NGINX 负载均衡算法
Using nginx as HTTP load balancer Using nginx as HTTP load balancer http://nginx.org/en/docs/http/lo ...
- 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 ...
- Uniform synchronization between multiple kernels running on single computer systems
The present invention allocates resources in a multi-operating system computing system, thereby avoi ...
- [摘录]quarts:Quartz Quick Start Guide
(Primarily authored by Dafydd James) Welcome to the QuickStart guide for Quartz. As you read this gu ...
- 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 ...
随机推荐
- Spring 整合Redis 出现 afterPropertiesSet signature: ()V) Incompatible argument to function 解决办法
正在做SpringMVC+Redis整合的练习 使用的是 spring-data-redis 和 Jedis 配置好之后出现了以下错误: Caused by: java.lang.VerifyErro ...
- 在Thinkphp3.2 中使用PHPMailer 发送邮件
phpmailer发送邮件是php开发者首选的一个邮件发送插件了,下面我来介绍怎么集成phpmailer到thinkphp框架了,有需要了解的朋友可参考. phpmailer发送邮件功能很强大,今天真 ...
- WPF开发技术介绍
本月做了一个小讲座,主要是WPF的开发技术介绍,由于是上班时间,去听的人不多,但对于自己来说至少是又巩固了Winform的知识,抽时间写一篇文章,在此分享给大家,有什么宝贵建议大家也可以提给我,谢谢. ...
- 最新game
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h&g ...
- 延长FLASH和EEPROM芯片写入次数的小方法
开发电子产品时,常常需要断电后保存某些数据,这就需要使用 FLASH或EEPROM芯片,这两种芯片,可擦除的次数是有限制的,通常FLASH为10万次,EEPROM要多一点,为100万甚至1000万次. ...
- 单片机IO处理 电容触摸按键
原理说明: 通过检测感应按键PAD的电容量变化来判断是否有触摸动作.当手指触摸PAD时,电容量增加,充放电时间变长. 本方案中利用M48的20个双向IO口实现了20个触摸按键,而且所用原器件最少.其中 ...
- AV 地址错误 map 文件 根据地址报错,查 Delphi 代码
1. 首先需要设置程序生成 map 文件.Project -> Options -> Linker -> Map file , Detailed 2. 计算公式Edit2.Text ...
- Maven实战七
转载:http://www.iteye.com/topic/973166 前言 Maven,发音是[`meivin],"专家"的意思.它是一个很好的项目管理工具,很早就进入了我的必 ...
- Java中的移位操作符
记住所有的移动位数,针对的都是补码来讲的,所以要先将十进制整数转换成补码后,然后再来进行移位操作 移位操作 还要注意类型的约束条件,例如int,移动范围是0-31位,所以看补码只能看最后五位,这才是有 ...
- common tar command
Compress tar -cvzf jy2653.2.tgz jy2653.2 Decompress tar -xvf jy2653.1.tgz