You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Robert Kanter (JIRA)" <ji...@apache.org> on 2014/02/13 01:01:24 UTC
[jira] [Commented] (OOZIE-1691) StackOverflowError in
TimestampedMessageParser.parseNextLine()
[ https://issues.apache.org/jira/browse/OOZIE-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13899789#comment-13899789 ]
Robert Kanter commented on OOZIE-1691:
--------------------------------------
The fix itself looks good; I'm glad it was so minimal :)
For the test
{code:java}
String log = "2009-06-24 02:43:13," + i
+ " DEBUG _L1_:323 - USER[oozie] GROUP[-] TOKEN[-] APP[example-forkjoinwf] "
+ "JOB[14-200904160239--found-C] ACTION[14-200904160239--example-C@1] End workflow state change";
{code}
should be
{code:java}
String log = "2009-06-24 02:43:13," + i
+ " DEBUG _L1_:323 - USER[oozie] GROUP[-] TOKEN[-] APP[example-forkjoinwf] "
+ "JOB[14-200904160239--found-C] ACTION[14-200904160239--example-C@1] End workflow state change\n";
{code}
(I added a {{\n}} at the end). Otherwise, all of those log messages end up on one line; and the test passes even without the fix!
> StackOverflowError in TimestampedMessageParser.parseNextLine()
> --------------------------------------------------------------
>
> Key: OOZIE-1691
> URL: https://issues.apache.org/jira/browse/OOZIE-1691
> Project: Oozie
> Issue Type: Bug
> Reporter: purshotam shah
> Assignee: purshotam shah
> Attachments: OOZIE-1691.patch
>
>
> Below function will throws StackOverflowError if no matching line is found for a few consecutive lines.
> This will be a common scenario in HA where bundle/coord/WF got executed in other host. For log aggregation we have to search logs in all host and may lead to StackOverflowError.
> {code:java}
> protected String parseNextLine() throws IOException {
> String line = reader.readLine();
> if (line != null) {
> ArrayList<String> logParts = filter.splitLogMessage(line);
> if (logParts != null) {
> patternMatched = filter.matches(logParts);
> }
> if (!patternMatched) {
> line = parseNextLine();
> }
> }
> return line;
> }
> {code}
> Exception
> Caused by: java.lang.StackOverflowError
> at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
> at java.util.regex.Pattern$Curly.match0(Pattern.java:4170)
> ...........................................
> at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
> at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
> at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
> at java.util.regex.Matcher.match(Matcher.java:1221)
> at java.util.regex.Matcher.matches(Matcher.java:559)
> at org.apache.oozie.util.XLogStreamer$Filter.splitLogMessage(XLogStreamer.java:138)
> at org.apache.oozie.util.TimestampedMessageParser.parseNextLine(TimestampedMessageParser.java:138)
> at org.apache.oozie.util.TimestampedMessageParser.parseNextLine(TimestampedMessageParser.java:143)
> at org.apache.oozie.util.TimestampedMessageParser.parseNextLine(TimestampedMessageParser.java:143)
> at org.apache.oozie.util.TimestampedMessageParser.parseNextLine(TimestampedMessageParser.java:143)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)