jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-2749) Closing a session twice shouldn't write a warning in the log
Date Wed, 15 Sep 2010 22:23:35 GMT

    [ https://issues.apache.org/jira/browse/JCR-2749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909918#action_12909918

Jukka Zitting commented on JCR-2749:

In revision 997496 I fixed the problem with duplicate closing of the system session.

In revision 997518 I turned the log level back to warnings as I believe the above fix addresses
the most prominent case of duplicate closing. The log messages now also come with additional
instructions on what to look for in order to fix the problems.

I agree about the concern over the relevancy of log messages, but I'd only lower the log level
if there remain other prominent cases where a more proper fix is too expensive.

Re: assertions; IMO assertions are best used as logic guards for code that you control entirely
- loop and class invariants, etc. In this case we're mostly guarding against bad behavior
by client code, and thus I think that logging warnings or in more extreme cases throwing exceptions
are more appropriate solutions than assertions.

> Closing a session twice shouldn't write a warning in the log
> ------------------------------------------------------------
>                 Key: JCR-2749
>                 URL: https://issues.apache.org/jira/browse/JCR-2749
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: 2.2.0
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.2.0
>         Attachments: sessionClose.txt
> When closing a session twice the following warning is written to the log file as of JCR-2741:
> "This session has already been closed. See the chained exception for a trace of where
the session was closed."
> I think the second "close()" should simply be ignored, without warning.

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

View raw message