db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyre Tjeldvoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3198) Using setQueryTimeout will leak sections
Date Tue, 13 Nov 2007 16:41:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542160

Dyre Tjeldvoll commented on DERBY-3198:

I writing this in a mail because I keep getting 503 from jira.

I have not looked at the issue you describe (since jira is down), 
but it sounds reasonable. 

I tried fixing this by letting
NetStatementRequest.writeSetSpecialRegister() just wrap its code in a
try - finally where the finally clause calls free() on the newly
allocated Section object. 

This seems to fix the leak, but you also change the
semantic. Previously setSpecialRegister() (actually EXCSETSTT) was put
in its own Section that was not used by any other statement, but with
this fix the next call to getDynamicSection() will likely reuse the
section number used by writeSetSpecialRegister(). Whether this
reperesents a problem or not, I don't know...

I tried reading the rules for assigning Section numbers in the DRDA
spec (Vol 1, section 7.15 pages 460-462), but that left me with more
questions than answers. It does seem like the section number should be
used to group statements that "belong together". If that is correct,
then I guess setQueryTimeout SHOULD have the same section number as
the statment that follows since they belong together...

Any DRDA experts reading this should feel free
to chime in...


> Using setQueryTimeout will leak sections 
> -----------------------------------------
>                 Key: DERBY-3198
>                 URL: https://issues.apache.org/jira/browse/DERBY-3198
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions:
>            Reporter: Dyre Tjeldvoll
>         Attachments: repro.diff
> The implementation of setQueryTimeout relies on NetStatementReply.writeSetSpecialRegister()
which will allocate a dynamic section when called. No reference to this Section object is
kept, and so Section.free() never gets called on it. Executing the same statment repeatedly
with a query timeout set results in the client driver throwing an exception because the number
of Sections exceeding 32000.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message