Skip to content

Fix for #8077#8119

Merged
AlexPeshkoff merged 3 commits intomasterfrom
work/8077
May 23, 2024
Merged

Fix for #8077#8119
AlexPeshkoff merged 3 commits intomasterfrom
work/8077

Conversation

@AlexPeshkoff
Copy link
Copy Markdown
Member

Error "Too many recursion levels" does not stop execuition of code that uses ON DISCONNECT trigger

…tion of code that uses ON DISCONNECT trigger
@AlexPeshkoff AlexPeshkoff requested a review from hvlad May 15, 2024 07:03
@AlexPeshkoff AlexPeshkoff self-assigned this May 15, 2024
Comment thread src/jrd/extds/ExtDS.cpp Outdated
Comment thread src/jrd/extds/ExtDS.cpp
Comment thread src/jrd/jrd.cpp
…ecuition of code that uses ON DISCONNECT trigger; Misc changes
@AlexPeshkoff
Copy link
Copy Markdown
Member Author

AlexPeshkoff commented May 22, 2024 via email

@AlexPeshkoff
Copy link
Copy Markdown
Member Author

Main problem is not what set of errors we log - what seems strange is that raising error in another place makes it invisible to logging call in a code, executing disconnect triggers.

@hvlad
Copy link
Copy Markdown
Member

hvlad commented May 22, 2024

Everything was logged:

Try without connections pool.

@hvlad
Copy link
Copy Markdown
Member

hvlad commented May 22, 2024

Main problem is not what set of errors we log - what seems strange is that raising error in another place makes it invisible to logging call in a code, executing disconnect triggers.

Error your mention is logged by purge_attachment() when TRIGGER_DISCONNECT is failed.
But, if that trigger was failed once (when called by Attachment::resetSession()) - it is not run by purge_attachment() anymore.

@hvlad
Copy link
Copy Markdown
Member

hvlad commented May 22, 2024

Main problem is not what set of errors we log - what seems strange is that raising error in another place makes it invisible to logging call in a code, executing disconnect triggers.

Error your mention is logged by purge_attachment() when TRIGGER_DISCONNECT is failed. But, if that trigger was failed once (when called by Attachment::resetSession()) - it is not run by purge_attachment() anymore.

Let me correct myself.

When first attachment in chain run's own TRIGGER_DISCONNECT, it have no ATT_resetting flag set. Thus Provider::releaseConnection() doesn't re-throws reset error (that happens in external attachment). I.e. here

		// check if reset of external session failed during resetting of parent (local) attachment
		const auto status = tdbb->tdbb_status_vector;
		if (!inPool && (att->att_flags & ATT_resetting) && status->hasData())
			resetError.loadFrom(status);

we need a way to know that our caller is TRIGGER_DISCONNECT.

Here is corrected patch:
gh8077-alt2.diff.txt

@AlexPeshkoff
Copy link
Copy Markdown
Member Author

AlexPeshkoff commented May 22, 2024 via email

…not stop execution of code that uses ON DISCONNECT trigger (FB 4.x+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error "Too many recursion levels" does not stop execution of code that uses ON DISCONNECT trigger (FB 4.x+)

2 participants