oracle/opengrok
View on GitHubClearcase file revisions from history are not served in Windows (Bugzilla #19038)
Open
#519 opened on May 22, 2013
bughelp wanted
Description
status NEW severity major in component scm for --- Reported in version unspecified on platform ANY/Generic Assigned to: Trond Norbye
On 2011-10-31 20:12:20 +0000, Srinivas Bss wrote:
OS: Windows 2003 JDK: 1.6 Update 21 SCM: Clearcase Web: Apache Tomcat 7.0 OpenGrok Version: 0.10
OpenGrok is unable to serve Clearcase revisions from history out of the box. Tomcat just hangs while fetching the information from Clearcase and CPU spikes to 100%.
After debugging, I found that drainStream() function in ClearCaseRepository.java is the root cause of the behavior. Modifying the function to get the available bytes from InputStream and then call skip() with that value resolved the issue.
private static void drainStream(InputStream in) throws IOException { while (true) { try { int to_skip = in.available(); in.skip(to_skip); } catch (IOException ioe) { // ignored - stream isn't seekable, but skipped variable still has correct value. OpenGrokLogger.getLogger().log(Level.FINEST, "Stream not seekable", ioe); } if (in.read() == -1) { // checked that we've reached EOF with read() break; } } in.close(); }