- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在使用带有 mysql 数据库的 sonarqube 4.5.4。
我在对我的项目运行分析时遇到了这个异常:
INFO o.d.m.sonar.runner.RunSonarVisitor - ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### The error may involve org.sonar.core.user.RoleMapper.insertGroupRole-Inline
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### The error occurred while setting parameters
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### SQL: INSERT INTO group_roles (group_id, resource_id, role) VALUES (?, ?, ?)
这是 SHOW ENGINE INNODB STATUS
的输出:
=====================================
2016-02-23 11:54:18 2b4ff4306700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 12 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 1238940 srv_active, 0 srv_shutdown, 970355 srv_idle
srv_master_thread log flush and writes: 0
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 13330
OS WAIT ARRAY INFO: signal count 13521
Mutex spin waits 1600127, rounds 719929, OS waits 5121
RW-shared spins 6726, rounds 123969, OS waits 2815
RW-excl spins 37472, rounds 641436, OS waits 2190
Spin rounds per wait: 0.45 mutex, 18.43 RW-shared, 17.12 RW-excl
------------------------
LATEST DETECTED DEADLOCK
------------------------
2016-02-23 05:33:42 2b5258087700
*** (1) TRANSACTION:
TRANSACTION 21846827, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 5 lock struct(s), heap size 376, 3 row lock(s), undo log entries 1
MySQL thread id 48914, OS thread handle 0x2b4ff2fbf700, query id 74518517 10.166.12.78 root update
INSERT INTO group_roles (group_id, resource_id, role)
VALUES (1, 209803, 'admin')
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 279 page no 410 n bits 1 index `group_roles_resource` of table `sonar`.`group_roles` trx id 21846827 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;
*** (2) TRANSACTION:
TRANSACTION 21846828, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 5 lock struct(s), heap size 376, 3 row lock(s), undo log entries 1
MySQL thread id 48921, OS thread handle 0x2b4ff4347700, query id 74518515 10.166.11.36 root update
INSERT INTO group_roles (group_id, resource_id, role)
VALUES (1, 209804, 'admin')
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 279 page no 410 n bits 1 index `group_roles_resource` of table `sonar`.`group_roles` trx id 21846828 lock_mode X
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 279 page no 410 n bits 1 index `group_roles_resource` of table `sonar`.`group_roles` trx id 21846828 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;
------------
TRANSACTIONS
------------
Trx id counter 22243718
Purge done for trx's n:o < 22161699 undo n:o < 0 state: running but idle
History list length 771
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 49478, OS thread handle 0x2b4ff4306700, query id 75735427 10.166.1.176 root init
SHOW ENGINE INNODB STATUS
---TRANSACTION 22243294, not started
MySQL thread id 49477, OS thread handle 0x2b4ff2fbf700, query id 75735410 10.166.1.176 root cleaned up
---TRANSACTION 22242581, not started
MySQL thread id 49474, OS thread handle 0x2b4ff4306700, query id 75735009 10.166.1.98 root delayed send ok done
---TRANSACTION 17172416, not started
MySQL thread id 42774, OS thread handle 0x2b4ff2efc700, query id 60565077 10.166.1.98 root cleaned up
---TRANSACTION 22243715, not started
MySQL thread id 10, OS thread handle 0x2b4fef6dd700, query id 75735423 localhost rdsadmin delayed send ok done
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
2704 OS file reads, 2704 OS file writes, 0 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Adaptive hash table 0: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 1: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 2: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 3: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 4: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 5: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 6: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 7: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 8: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 9: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 10: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 11: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 12: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 13: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 14: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 15: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 16: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 17: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 18: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 19: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 20: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 21: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 22: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 23: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 24: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 25: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 26: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 27: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 28: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 29: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 30: Hash table size 495359, node heap has 0 buffer(s)
Adaptive hash table 31: Hash table size 495359, node heap has 0 buffer(s)
0.00 hash searches/s, 44.91 non-hash searches/s
---
LOG
---
Log sequence number 8204
Log flushed up to 8204
Pages flushed up to 8204
Last checkpoint at 8192
0 pending log writes, 0 pending chkp writes
0 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 0; in additional pool allocated 0
Dictionary memory allocated 1951054
Buffer pool size 488518
Free buffers 79640
Database pages 408878
Old database pages 150893
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0 single page 0
Pages made young 38024, not young 16
0.00 youngs/s, 0.00 non-youngs/s
Pages read 200, created 428488, written 0
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 408878, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
----------------------
INDIVIDUAL BUFFER POOL INFO
----------------------
---BUFFER POOL 0
Buffer pool size 244259
Free buffers 40396
Database pages 203863
Old database pages 75234
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0 single page 0
Pages made young 19914, not young 12
0.00 youngs/s, 0.00 non-youngs/s
Pages read 106, created 212739, written 0
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 203863, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
---BUFFER POOL 1
Buffer pool size 244259
Free buffers 39244
Database pages 205015
Old database pages 75659
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0 single page 0
Pages made young 18110, not young 4
0.00 youngs/s, 0.00 non-youngs/s
Pages read 94, created 215749, written 0
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 205015, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Main thread process no. 4380, id 47632657958656, state: sleeping
Number of rows inserted 18537127, updated 1761791, deleted 1114846, read 1897702042
0.00 inserts/s, 0.50 updates/s, 0.00 deletes/s, 4.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
你能帮帮我吗
最佳答案
您可以在配置中尝试 innodb_locks_unsafe_for_binlog = 1
吗?
这里是 documentation :实际上这意味着 select for update
使表锁定。关于 locks in innodb 的更多信息.
这里仍然有一些问号,但这是我的第一个想法。如果这仍然是一个问题......让我们从那个 binlog 设置开始。
关于mysql - Sonar 库 4.5.4 : MySQL deadlock,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35578144/
什么是僵局有益的例子? 最佳答案 如果你死锁的程序是病毒? 如果你想卡住一个进程,我想那将是你唯一应该这样做的时候......大声笑。 关于deadlock - 在什么情况下僵局是好事?,我们在Sta
我正在调试一个死锁问题,调用堆栈显示线程正在等待某些事件。 代码使用临界区作为同步原语我认为这里存在一些问题。 此外,调试器指向某个其他线程拥有的临界区,但锁计数为 -2。 根据我的理解 lock c
我已经用多种语言进行了编程,但我不知道我的代码中存在死锁。 我认为这意味着它不会发生。 这是否经常发生(在编程中, 而不是 在数据库中)足以让我担心吗? 最佳答案 如果两个条件为真,就会出现死锁:您有
我一直在读《The Little Book of Semaphores》,第 41 页有一个针对可重用屏障问题的解决方案。我遇到的问题是为什么它不会产生死锁情况。 1 # rendezvous 2 3
是否有任何方法可以在同一台计算机上运行NBD(网络 block 设备)客户端和服务器而不导致系统死锁? 我非常疲惫地寻找这个问题的答案。如果有人可以提供帮助,我将不胜感激。 更新: 我正在编写一个与
当我用 java 程序运行我的 jvmti 代理时,jvm 似乎遇到了死锁。在我的 jvmti 代理中,我在 Agent_OnLoad() 中创建了一个原始监视器,并在每个回调函数开始时进入该锁,并在
嗨,我正在尝试实现与多个客户端一起运行的服务器问题是服务器没有从输入流接收消息并等待它发生。如果客户端在写入后不关闭流,服务器将继续等待。客户端发送消息后,他尝试从输入流中读取等待响应,但服务器正在等
对于像这样的伪函数 void transaction(Account from, Account to, double amount){ Semaphore lock1, lock2;
死锁很难发现,而且消除起来也很不舒服。 如何找到代码中死锁的错误源?是否存在“死锁模式”? 在我的特殊情况下,它涉及数据库,但这个问题对于每个死锁都是开放的。 最佳答案 更新:最近的 MSDN 文章
在 java 中使用 Runtime.exec() 创建子进程时,我知道我必须填充输入/排出输出流以防止子进程阻塞。 有趣的是,Process 的javadoc多说一点: ...failure to
我正在努力用简单的词来解释线程中的“死锁”,所以请帮忙。什么是“死锁”的最佳示例(例如,在Java中),它如何逐步发生以及如何防止死锁?但无需深入细节。我知道这就像问两个相反的事情,但仍然如此。如果您
对于那些不熟悉的人,以下是用于流程协调的Peterson算法: int No_Of_Processes; // Number of processes int turn; // Whose turn
我在使用以下示例代码时遇到问题: from multiprocessing import Lock, Process, Queue, current_process def worker(work_q
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topi
给定以下 Java 代码: public class Test { static private class MyThread extends Thread { private
当我尝试在 C# 中从 SQL 数据库中获取数据时,生成了这两个异常: System.Data.SqlClient.SqlException: Transaction (Process ID 97)
在另一方释放资源前,会话1和会话2都不可能继续。所以,SQL Server会选择死锁中的一个会话作为“死锁牺牲品”。 注意:死锁牺牲品的会话会被杀死,事务会被回滚。 注意:死锁与正常的阻塞是两个
两个线程同时访问fileName。 Set If 0 使死锁。但如果 1 一切顺利。 那么是什么导致了这种情况? 最佳答案 确保您没有在主线程上同步调用 +[PHAssetResource asset
我有一个带有弹出菜单的单线程 FLTK 应用程序,使用 Fluid 创建。我有一个子类 Fl_Gl_Window 并实现了一个 handle() 方法。 handle() 方法调用一个函数,该函数在右
package main import ( "fmt" "net/http" ) func Extract(url string) ([]string, error) { ht
我是一名优秀的程序员,十分优秀!