25.03.2020 10:37, Alex Peshkoff via Firebird-devel wrote:
On 2020-03-24 19:50, Vlad Khorsun wrote:
Added first in Provider::generateDPB(), next in (any-)Connection::attach().
Vlad, I'm unsure - what place is correct one?
Second was added with connections pool implementation in master. This part
requires
some completion. isc_dpb_ext_call_depth was introduced by me at initial
implementation
of EDS to detect and prevent too deep recursion within EDS.
isc_dpb_ext_call_depth
passed at attach() with incremented call depth counter of local attachment.
Now, with
connections pooling, I need a way to set call depth counter of re-used
attachment.
So far we have no such way and I open for suggestions. When this will be
implemented,
isc_dpb_ext_call_depth could be removed from Provider::generateDPB(). Currently
it
works as a some protection from bad scenarios with recursive calls of EDS.
It should help from infinite recursion - pools on involved servers should overflow at some step, and tag will work as before.
Though certainly it's not precise result.
Not sure I got you here - why it is not precise ?
Because (as far as I understood current code) it can fire when callbacks' depth is not precisely MAX_CALLBACKS but less or bigger
than it.
DPB generated with Provider::generateDPB() is used to find pooled connection
with same
parameters. It is includes isc_dpb_ext_call_depth tag (so far). Therefore it
will choose
pooled connection with the same value of "call depth". And it is the reason why
it makes
pooling less efficient than it could be if isc_dpb_ext_call_depth not used
while looking
for connection to reuse.
May be better solution is related with attachment's reset?
Pooled connection is reset when released, not when reused.
Sorry - what reasons for it?
IIRC, it was discussed here when "external connections pool" feature was
introduced.
Session reset is used instead of disconnect, it allows to free session
resources early
and to not put into the pool connection that can't be reset (by any reason).
Regards,
Vlad
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel