Letractively / tsab

Automatically exported from code.google.com/p/tsab
GNU Affero General Public License v3.0
0 stars 0 forks source link

Problem with too many open files #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It seems that TSAB doesn't close all resources properly.
After some time (a week or so with very moderate usage (10 people per day)), 
the following exception is reported in the log file:
SEVERE: Servlet.service() for servlet TsabAudioDownloadServlet threw exception
java.io.FileNotFoundException: 
/home/webspeech/tsab/audio/vastasseis20101217##001.mp3 (Too many open files)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at ee.ioc.phon.tsab.web.TsabAudioDownloadServlet.sendAudio(TsabAudioDownloadServlet.java:70)
        at ee.ioc.phon.tsab.web.TsabAudioDownloadServlet.doGet(TsabAudioDownloadServlet.java:52)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)

This in turn causes all sorts of other problems, e.g.:

19:26:51,495 DEBUG TsabServlet:58 - Handling page: /play
java.io.IOException: directory '/home/webspeech/tsab/lucene' exists and is a 
directory, but cannot be listed: list() returned null
        at org.apache.lucene.store.FSDirectory.listAll(FSDirectory.java:234)
        at org.apache.lucene.store.FSDirectory.listAll(FSDirectory.java:245)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:568)
        at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:69)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:316)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:202)
        at ee.ioc.phon.tsab.common.Search.getLuceneSearcher(Search.java:73)
        at ee.ioc.phon.tsab.common.Search.getDocumentId(Search.java:109)
        at ee.ioc.phon.tsab.dao.TsabDao.getRelatedRecordings(TsabDao.java:467)
        at ee.ioc.phon.tsab.web.TsabServlet.handlePlay(TsabServlet.java:196)
        at ee.ioc.phon.tsab.web.TsabServlet.doGet(TsabServlet.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)

Tomcat restart resolves the problem

Original issue reported on code.google.com by alu...@gmail.com on 20 Dec 2010 at 1:12

GoogleCodeExporter commented 8 years ago

Original comment by alu...@gmail.com on 20 Dec 2010 at 1:12

GoogleCodeExporter commented 8 years ago
committed, trying to close file streams more carefully now.

Original comment by ahti.kit...@gmail.com on 23 Dec 2010 at 4:51