Skip to content

Commit 2d175b4

Browse files
committed
Revert "Attempt to fix hanging transaction locks after various exceptions or BUGCHECK"
This reverts commit bcb6462.
1 parent 6cbee94 commit 2d175b4

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

src/jrd/jrd.cpp

+9-11
Original file line numberDiff line numberDiff line change
@@ -7667,17 +7667,6 @@ void release_attachment(thread_db* tdbb, Jrd::Attachment* attachment, XThreadEns
76677667

76687668
attachment->destroyIntlObjects(tdbb);
76697669

7670-
{
7671-
// Destroy transactions and release their locks
7672-
// before detaching them from the attachment.
7673-
jrd_tra* next = NULL;
7674-
for (jrd_tra* tran = attachment->att_transactions; tran; tran = next)
7675-
{
7676-
next = tran->tra_next;
7677-
jrd_tra::destroy(attachment, tran);
7678-
}
7679-
}
7680-
76817670
attachment->detachLocks();
76827671

76837672
LCK_fini(tdbb, LCK_OWNER_attachment);
@@ -7769,6 +7758,15 @@ void release_attachment(thread_db* tdbb, Jrd::Attachment* attachment, XThreadEns
77697758

77707759
delete attachment->att_user;
77717760

7761+
{
7762+
jrd_tra* next = NULL;
7763+
for (jrd_tra* tran = attachment->att_transactions; tran; tran = next)
7764+
{
7765+
next = tran->tra_next;
7766+
jrd_tra::destroy(attachment, tran);
7767+
}
7768+
}
7769+
77727770
tdbb->setAttachment(NULL);
77737771
Jrd::Attachment::destroy(attachment);
77747772
}

src/jrd/lck.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -1483,19 +1483,18 @@ Lock::Lock(thread_db* tdbb, USHORT length, lck_t type, void* object, lock_ast_t
14831483

14841484
Lock::~Lock()
14851485
{
1486-
// lck_id might be set if exception or bugcheck occurs
1487-
if (lck_id)
1486+
fb_assert(lck_id == 0);
1487+
fb_assert(!lck_attachment.hasData());
1488+
1489+
if (lck_attachment || lck_next || lck_prior)
14881490
{
14891491
#ifdef DEBUG_LCK_LIST
1490-
if (lck_attachment || lck_next || lck_prior)
1491-
{
1492-
gds__log("DEBUG_LCK_LIST: Lock::~Lock(): this 0x%p, attachment 0x%p, lck_type %d, lck_next 0x%p, lck_prior 0x%p",
1493-
this, lck_attachment ? lck_attachment->getHandle() : NULL,
1494-
(int) lck_type, lck_next, lck_prior);
1495-
}
1492+
gds__log("DEBUG_LCK_LIST: Lock::~Lock(): this 0x%p, attachment 0x%p, lck_type %d, lck_next 0x%p, lck_prior 0x%p",
1493+
this, lck_attachment ? lck_attachment->getHandle() : NULL,
1494+
(int) lck_type, lck_next, lck_prior);
14961495
#endif
14971496

1498-
LCK_release(JRD_get_thread_data(), this);
1497+
setLockAttachment(NULL);
14991498
}
15001499
}
15011500

src/jrd/tra.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -3790,7 +3790,6 @@ jrd_tra::~jrd_tra()
37903790
MemoryPool::deletePool(tra_autonomous_pool);
37913791

37923792
delete tra_sec_db_context;
3793-
delete tra_lock;
37943793
}
37953794

37963795

0 commit comments

Comments
 (0)