Opened 16 years ago

Closed 16 years ago

#1225 closed defect (fixed)

Base1PluginExecuter crashes with "The connection has been closed" if the BASE 1 plug-in creates a subdirectory

Reported by: Jari Häkkinen Owned by: everyone
Priority: blocker Milestone: BASE 2.9.2
Component: coreplugins Version: 2.9.1
Keywords: Cc:

Description

This happens with several (all?) configuration on our machine.

Stacktrace:

net.sf.basedb.core.ConnectionClosedException: The connection has been closed.
at net.sf.basedb.core.DbControl.newItem(DbControl.java:650)
at net.sf.basedb.core.Directory.getNew(Directory.java:96)
at net.sf.basedb.core.Directory.newSubDirectory(Directory.java:773)
at net.sf.basedb.plugins.Base1PluginExecuter.importTempFiles(Base1PluginExecuter.java:1956)
at net.sf.basedb.plugins.Base1PluginExecuter.run(Base1PluginExecuter.java:659)
at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:106)
at net.sf.basedb.clients.jobagent.executors.ThreadJobExecutor.executeJob(ThreadJobExecutor.java:109)
at net.sf.basedb.clients.jobagent.executors.ThreadJobExecutor.main(ThreadJobExecutor.java:202)

Change History (9)

comment:1 by Nicklas Nordborg, 16 years ago

I cannot reproduce the same error. The test plug-in (a simple plug-in which just copies stdin.txt to stdout.txt) we have runs fine to begin with. I do get an error if the directory where the files should be stored has the "Share new files and subdirectories automatically" option selected. The error message is the same, but the stacktrace is a bit different:

net.sf.basedb.core.ConnectionClosedException: The connection has been closed.
at net.sf.basedb.core.DbControl.getItem(DbControl.java:731)
at net.sf.basedb.core.SharedItem.getItemKey(SharedItem.java:59)
at net.sf.basedb.core.ShareableUtil.copyPermissions(ShareableUtil.java:174)
at net.sf.basedb.core.File.getNew(File.java:103)
at net.sf.basedb.plugins.Base1PluginExecuter.importTempFiles(Base1PluginExecuter.java:1939)
at net.sf.basedb.plugins.Base1PluginExecuter.run(Base1PluginExecuter.java:659)
at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:106)
at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:504)
at java.lang.Thread.run(Thread.java:619)

Maybe there are two different problems that happens to have a similar outcome. Is the plug-in you are testing with creating subdirectories as well as files?

comment:2 by Nicklas Nordborg, 16 years ago

I have extended the test plug-in to also include a test that creates a subdirectory and this reproduces the original error. In this case it doesn't matter if the "Share new files and subdirectories automatically" is selected or not. The workaround mentioned above only works for plug-ins that doesn't create additional subdirectories. Here is the stack trace from the test program.

net.sf.basedb.core.BaseException: Error invoking plugin: The connection has been closed.
        at TestJob.test_execute(TestJob.java:97)
        at TestBase1PluginExecuter.test_all(TestBase1PluginExecuter.java:115)
        at TestBase1PluginExecuter.main(TestBase1PluginExecuter.java:51)
Caused by: net.sf.basedb.core.ConnectionClosedException: The connection has been closed.
        at net.sf.basedb.core.BasicItem.getDbControl(BasicItem.java:320)
        at net.sf.basedb.core.Directory.newSubDirectory(Directory.java:773)
        at net.sf.basedb.plugins.Base1PluginExecuter.importTempFiles(Base1PluginExecuter.java:1956)
        at net.sf.basedb.plugins.Base1PluginExecuter.run(Base1PluginExecuter.java:659)
        at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:106)
        at TestJob.test_execute(TestJob.java:92)

So... I have found two cases where the Base1PluginExecuter fails, but the original error report indicates that it may happen to all BASE 1 plug-ins. If that is so, do you have any more information regarding other circumstances where this (or a similar) problem may happen?

in reply to:  2 comment:3 by Jari Häkkinen, 16 years ago

Replying to nicklas:

I cannot reproduce the same error. The test plug-in (a simple plug-in which just copies stdin.txt to stdout.txt) we have runs fine to begin with. I do get an error if the directory where the files should be stored has the "Share new files and subdirectories automatically" option selected. The error message is the same, but the stacktrace is a bit different:

[snip]

Maybe there are two different problems that happens to have a similar outcome. Is the plug-in you are testing with creating subdirectories as well as files?

A sub-directory is always created and optionally files also. The share automatically option is usually true for our users (we recommend that setting). In this case the owner of the file structure is trying to run the failing jobs.

in reply to:  2 comment:4 by Jari Häkkinen, 16 years ago

Replying to nicklas:

I have extended the test plug-in to also include a test that creates a subdirectory and this reproduces the original error. In this case it doesn't matter if the "Share new files and subdirectories automatically" is selected or not. The workaround mentioned above only works for plug-ins that doesn't create additional subdirectories. Here is the stack trace from the test program.

[snip]

So... I have found two cases where the Base1PluginExecuter fails, but the original error report indicates that it may happen to all BASE 1 plug-ins. If that is so, do you have any more information regarding other circumstances where this (or a similar) problem may happen?

All Base1 plug-ins failed on our machine so we stopped it. In this case all is equal to three (of 34 possible). The common trait of the failing configurations is that they all create new sub-directories.

Should I try a configuration that does not create a sub-directory?

comment:5 by Nicklas Nordborg, 16 years ago

(In [4713]) References #1225: Base1PluginExecuter crashes with "The connection has been closed"

Added test-case where the plug-in creates a subdirectory.

comment:6 by Nicklas Nordborg, 16 years ago

Summary: Base1PluginExecuter crashes with "The connection has been closed"Base1PluginExecuter crashes with "The connection has been closed" if the BASE 1 plug-in creates a subdirectory

No need to test, but ... I don't think testing 3 plug-ins can account for saying that it "happens with several (all?)" as in the original report.

comment:7 by Nicklas Nordborg, 16 years ago

The other problem mentioned in the first comment has been moved to a separate ticket (#1226) since it is a different problem.

comment:8 by Nicklas Nordborg, 16 years ago

(In [4715]) References #1225: Base1PluginExecuter crashes with "The connection has been closed"

Fixed the checked in test code so that it actually creates the subdirectory.

comment:9 by Nicklas Nordborg, 16 years ago

Resolution: fixed
Status: newclosed

(In [4716]) Fixes #1225: Base1PluginExecuter crashes with "The connection has been closed" if the BASE 1 plug-in creates a subdirectory

Note: See TracTickets for help on using tickets.