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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2011/03/02 13:40:37 UTC

[jira] Created: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

ShutdownException in ContextManager.checkInterrupt() during shutdown
--------------------------------------------------------------------

                 Key: DERBY-5082
                 URL: https://issues.apache.org/jira/browse/DERBY-5082
             Project: Derby
          Issue Type: Bug
          Components: Services
    Affects Versions: 10.8.0.0
            Reporter: Knut Anders Hatlen


When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Updated: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Kristian Waagan updated DERBY-5082:
-----------------------------------

    Attachment: derby-5082-1a-fix.diff

Attached patch 1a, which fixes the bug with a ShutdownException raised in ContextManager by avoiding to destroy the tx if the database is shut down. Also, if the transaction is being destroyed, catch ShutdownException in case someone shuts down the database under our feet. This is already done in the main processing loop if the worker thread detects that the daemon has been stopped.

Since the patch is so small and isolated, I committed it right away with revision 1076462.

The coming patch for DERBY-5088 will be larger, so I'll need to run more tests before committing.

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: derby-5082-1a-fix.diff, test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Updated: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Knut Anders Hatlen updated DERBY-5082:
--------------------------------------

    Attachment: test.sql

Attaching repro script. Here's what I see when running it:

$ java org.apache.derby.tools.ij test.sql
ij version 10.8
ij> connect 'jdbc:derby:db;create=true';
ij> create table t(x int);
0 rows inserted/updated/deleted
(...)
ij> insert into t select * from t;
22528 rows inserted/updated/deleted
ij> select count(*) from t where x > 50;
1          
-----------
4096       

1 row selected
ij> Exception in thread "main" org.apache.derby.iapi.error.ShutdownException: 
	at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:464)
	at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:202)
	at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:81)
	at org.apache.derby.impl.store.raw.xact.Xact.close(Xact.java:1169)
	at org.apache.derby.impl.store.raw.xact.Xact.destroy(Xact.java:1110)
	at org.apache.derby.impl.store.access.RAMTransaction.destroy(RAMTransaction.java:2030)
	at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.stop(IndexStatisticsDaemonImpl.java:866)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.stop(DataDictionaryImpl.java:974)
	at org.apache.derby.impl.services.monitor.TopService.stop(TopService.java:443)
	at org.apache.derby.impl.services.monitor.TopService.shutdown(TopService.java:394)
	at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(BaseMonitor.java:229)
	at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(BaseMonitor.java:199)
	at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:241)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:144)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:207)
	at org.apache.derby.impl.tools.ij.utilMain.cleanupGo(utilMain.java:429)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:262)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Issue Comment Edited: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Kristian Waagan edited comment on DERBY-5082 at 3/2/11 10:13 PM:
-----------------------------------------------------------------

I extracted one of the istat bug reports (the one with the factory call) and created DERBY-5088.

      was (Author: kristwaa):
    I extracted the istat bug report and created DERBY-5088.
  
> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Closed: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Knut Anders Hatlen closed DERBY-5082.
-------------------------------------


Thanks for fixing this, Kristian! I've run the repro script 50 times without seeing the exception. It used to see it on every other run or so, so it appears to be fixed. Closing the bug.

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>             Fix For: 10.8.0.0
>
>         Attachments: derby-5082-1a-fix.diff, test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Commented: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Knut Anders Hatlen commented on 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.

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Updated: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Rick Hillegas updated DERBY-5082:
---------------------------------

    Urgency: Blocker

Marking this as a blocker for 10.8.1 because I think this regression is likely to affect a lot of users.

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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

        

[jira] Resolved: (DERBY-5082) ShutdownException in ContextManager.checkInterrupt() during shutdown

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

Kristian Waagan resolved DERBY-5082.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.8.0.0
         Assignee: Kristian Waagan

I can't reproduce the bug with the fix applied, would be nice if others gave the repro a try too (it doesn't take long to run, but it is wise to delete the database between the runs).
I didn't see the DERBY-5088 either, but that must be because the timing is different on my machine.

> ShutdownException in ContextManager.checkInterrupt() during shutdown
> --------------------------------------------------------------------
>
>                 Key: DERBY-5082
>                 URL: https://issues.apache.org/jira/browse/DERBY-5082
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>             Fix For: 10.8.0.0
>
>         Attachments: derby-5082-1a-fix.diff, test.sql
>
>
> When running the attached repro script, I often (but not always) see a ShutdownException in ContextManager.checkInterrupt() when ij exits and shuts down the Derby engine. ij expects an exception here, but it expects an SQLException, not a ShutdownException.

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