You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2011/03/02 23:10:37 UTC

[jira] Created: (DERBY-5088) ShutdownException raised in istat thread during factory call

ShutdownException raised in istat thread during factory call
------------------------------------------------------------

                 Key: DERBY-5088
                 URL: https://issues.apache.org/jira/browse/DERBY-5088
             Project: Derby
          Issue Type: Bug
          Components: Services, Store
    Affects Versions: 10.8.0.0
            Reporter: Knut Anders Hatlen
            Assignee: Kristian Waagan
            Priority: Minor


Reported by Knut Anders in DERBY-5082:
---
While running the repro script, I've also seen this exception printed to the console:

Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
at java.lang.Thread.run(Thread.java:619)

ij didn't error out in that case, though.
---

This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-5088:
-----------------------------------

    Issue & fix info: [Patch Available]

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001920#comment-13001920 ] 

Knut Anders Hatlen commented on DERBY-5088:
-------------------------------------------

Thanks, Kristian! I ran the DERBY-5082 repro script 70 times with the patch without seeing any problems, but I've only seen this problem once, so it's difficult to say for sure whether the problem is fixed. But in any case, +1 to commit.

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Lily Wei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002181#comment-13002181 ] 

Lily Wei commented on DERBY-5088:
---------------------------------

Thanks, Kristian!! From looking at the code, I don't see much. When running the repro script, if I use the same db and get error and harmless telling me database exist and view already there, the script will hang. I understand this is a negative test. However, is this the expect behavior for the fix? Hope this help!

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Lily Wei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002316#comment-13002316 ] 

Lily Wei commented on DERBY-5088:
---------------------------------

That's okay. I understand. Thank Kristian for getting back to me so quickly.
I meant when I was looking at the code, the code seems to do the right thing. My only concern is whether daemonLCC.getDatabase().isActive() at IndexStatisticDaemonImpl.isShuttingDown() always reflects reality. Will isActive() method only return true when database is up and running. However, I couldn't come out with a case that the value does not reflect reality. 

You are right about the database grow very large. After running ij with more memory, I can see the row grow to more than millions. It is still running after 20 minutes. If I do see stacktrace, I will post them. Thanks!

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan resolved DERBY-5088.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.8.0.0

Resolving issue.

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.8.0.0
>
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002238#comment-13002238 ] 

Kristian Waagan commented on DERBY-5088:
----------------------------------------

Sorry Lily, I didn't see your comment before after I committed the fix to trunk with revision 1076802.

I don't quite understand what you mean with "From looking at the code, I don't see much." Can you please clarify?
Note that if you reuse the database between runs it will quickly grow very large and may appear to hang while it is inserting data.

The expected behavior for the fix is that you won't see the error / stacktrace reported by Knut when ij is exiting (which it will do when it has executed all the SQL commands in the script file). Since the bug is intermittent, it is not that easy to "prove" that it will never happen again.
If you see it now, the stacktrace should be different.

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-5088) ShutdownException raised in istat thread during factory call

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-5088:
-----------------------------------

    Attachment: derby-5088-1a-shutdownexception_refactor.diff

Attaching patch 1a for review.
Refactors the exception handling code somewhat, and moves the factory call inside the try-catch.

> ShutdownException raised in istat thread during factory call
> ------------------------------------------------------------
>
>                 Key: DERBY-5088
>                 URL: https://issues.apache.org/jira/browse/DERBY-5088
>             Project: Derby
>          Issue Type: Bug
>          Components: Services, Store
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5088-1a-shutdownexception_refactor.diff
>
>
> Reported by Knut Anders in DERBY-5082:
> ---
> While running the repro script, I've also seen this exception printed to the console:
> Exception in thread "index-stat-thread" org.apache.derby.iapi.error.ShutdownException:
> at org.apache.derby.iapi.services.context.ContextService.getFactory(ContextService.java:210)
> at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:700)
> at java.lang.Thread.run(Thread.java:619)
> ij didn't error out in that case, though.
> ---
> This happens when the database is shut down before the istat worker thread has been initialized.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira