New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-12480
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Unassigned
Reporter: Igor Ristic
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JIRA

CVS module of JIRA closes STDOUT

Created: 28/Mar/07 11:05 PM   Updated: 04/Apr/07 02:23 AM
Component/s: CVS integration
Affects Version/s: 3.8
Fix Version/s: 3.8.1

Time Tracking:
Not Specified

File Attachments: 1. Java Source File IOGuardianListener.java (7 kB)


Participants: Anton Mazkovoi [Atlassian], David Delbecq, Igor Ristic and Jed Wesley-Smith [Atlassian]
Since last comment: 1 year, 21 weeks, 1 day ago
Resolution Date: 04/Apr/07 02:23 AM
Labels:


 Description  « Hide
Quoting the error description:

I can confirm that the cvs components of JIRA do indirectly attempt close the logs, resulting in a close of System.err, which, due to tomcat invocation redirection, is the same as stdout. I have attached a wrapping Stream to stderr that dumps a stacktrace whenever someone attempts to close it. Here is it's output (there are plenty of those at JIRA startup):

java.lang.Exception: Someone tried to close the stream System.err
        at be.rmi.intranet.tomcat.IOGuardianListener$GuardedStream.close(IOGuardianListener.java:95)
        at org.apache.jasper.util.SystemLogHandler.close(SystemLogHandler.java:123)
        at org.apache.jasper.util.SystemLogHandler.close(SystemLogHandler.java:123)
        at org.apache.jasper.util.SystemLogHandler.close(SystemLogHandler.java:123)
        at com.jcraft.jsch.IO.close(Unknown Source)
        at com.jcraft.jsch.Channel.disconnect(Unknown Source)
        at org.netbeans.lib.cvsclient.connection.ExtConnection.close(Unknown Source)
        at com.atlassian.jira.vcs.cvsimpl.CvsRepositoryUtilImpl.updateCvs(CvsRepositoryUtilImpl.java:427)
        at com.atlassian.jira.vcs.cvsimpl.CvsRepository.updateCvs(CvsRepository.java:232)
        at com.atlassian.jira.vcs.cvsimpl.CvsRepository.updateRepository(CvsRepository.java:287)
        at com.atlassian.jira.vcs.DefaultRepositoryManager.updateRepository(DefaultRepositoryManager.java:547)
        at com.atlassian.jira.vcs.DefaultRepositoryManager.updateRepositories(DefaultRepositoryManager.java:500)
        at com.atlassian.jira.service.services.vcs.VcsService.run(VcsService.java:54)
        at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:67)
        at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

Here is, basically, the code used to 'guard' System.err stream:

PrintStream err = System.err;
err.flush();
System.setErr(new GuardedStream(err,"System.err"));

GuardedStream follows simply the delegation pattern, except for close() where it refuses the close() operation and dumps a stacktrace to stdout.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Anton Mazkovoi [Atlassian] added a comment - 01/Apr/07 11:16 PM
Looks like the problem happens when using the ext protocol to connect to the CVS server. Not sure if this is the case with all CVS protocols.

David Delbecq added a comment - 02/Apr/07 01:34 AM
For background information, in my case, this happened with the cvs server accessed via ssh. (CVS Root: :ext:user@server:/path/to/root)

David Delbecq added a comment - 02/Apr/07 02:38 AM
Attached a tomcat listener that, when added to server.xml at top level prevents the closing of stream and issue a warning. I am not sure about the impact this non closing call has over the cvs checkout process but at least you keep the logs in catalina.out. This can server as a temporary workaround to people. Licence under apache 2.0 licence.

Jed Wesley-Smith [Atlassian] added a comment - 04/Apr/07 02:23 AM
Awesome David, thanks for the analysis and the code - made life real easy.

For future reference, the link for configuring a LifecycleListener is here