[jira] Created: (NUTCH-502) Bug in SegmentReader causes infinite loop

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (NUTCH-502) Bug in SegmentReader causes infinite loop

Parth (Jira)
Bug in SegmentReader causes infinite loop
-----------------------------------------

                 Key: NUTCH-502
                 URL: https://issues.apache.org/jira/browse/NUTCH-502
             Project: Nutch
          Issue Type: Bug
            Reporter: Doğacan Güney
            Assignee: Doğacan Güney
            Priority: Minor
             Fix For: 1.0.0


A small bug in SegmentReader.get() may lead to an infinite loop.

...
    int cnt = 0;
    do {
      try {
        Thread.sleep(5000);
      } catch (Exception e) {};
      it = threads.iterator();
      while (it.hasNext()) {
        if (((Thread)it.next()).isAlive()) cnt++;
      }
      if ((cnt > 0) && (LOG.isDebugEnabled())) {
        LOG.debug("(" + cnt + " to retrieve)");
....

      }
    } while (cnt > 0);


If cnt ever becomes non-zero, SegmentReader gets stuck in that loop.

This bug is discovered by Ilya Vishnevsky.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NUTCH-502) Bug in SegmentReader causes infinite loop

Parth (Jira)

     [ https://issues.apache.org/jira/browse/NUTCH-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doğacan Güney updated NUTCH-502:
--------------------------------

    Attachment: segment_reader_hang.patch

Patch is contributed by Ilya Vishnevsky.

I will give this a couple of hours and then commit it if there are no objections.

> Bug in SegmentReader causes infinite loop
> -----------------------------------------
>
>                 Key: NUTCH-502
>                 URL: https://issues.apache.org/jira/browse/NUTCH-502
>             Project: Nutch
>          Issue Type: Bug
>            Reporter: Doğacan Güney
>            Assignee: Doğacan Güney
>            Priority: Minor
>             Fix For: 1.0.0
>
>         Attachments: segment_reader_hang.patch
>
>
> A small bug in SegmentReader.get() may lead to an infinite loop.
> ...
>     int cnt = 0;
>     do {
>       try {
>         Thread.sleep(5000);
>       } catch (Exception e) {};
>       it = threads.iterator();
>       while (it.hasNext()) {
>         if (((Thread)it.next()).isAlive()) cnt++;
>       }
>       if ((cnt > 0) && (LOG.isDebugEnabled())) {
>         LOG.debug("(" + cnt + " to retrieve)");
> ....
>       }
>     } while (cnt > 0);
> If cnt ever becomes non-zero, SegmentReader gets stuck in that loop.
> This bug is discovered by Ilya Vishnevsky.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (NUTCH-502) Bug in SegmentReader causes infinite loop

Parth (Jira)
In reply to this post by Parth (Jira)

     [ https://issues.apache.org/jira/browse/NUTCH-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doğacan Güney resolved NUTCH-502.
---------------------------------

    Resolution: Fixed

Committed in rev. 548666.

> Bug in SegmentReader causes infinite loop
> -----------------------------------------
>
>                 Key: NUTCH-502
>                 URL: https://issues.apache.org/jira/browse/NUTCH-502
>             Project: Nutch
>          Issue Type: Bug
>            Reporter: Doğacan Güney
>            Assignee: Doğacan Güney
>            Priority: Minor
>             Fix For: 1.0.0
>
>         Attachments: segment_reader_hang.patch
>
>
> A small bug in SegmentReader.get() may lead to an infinite loop.
> ...
>     int cnt = 0;
>     do {
>       try {
>         Thread.sleep(5000);
>       } catch (Exception e) {};
>       it = threads.iterator();
>       while (it.hasNext()) {
>         if (((Thread)it.next()).isAlive()) cnt++;
>       }
>       if ((cnt > 0) && (LOG.isDebugEnabled())) {
>         LOG.debug("(" + cnt + " to retrieve)");
> ....
>       }
>     } while (cnt > 0);
> If cnt ever becomes non-zero, SegmentReader gets stuck in that loop.
> This bug is discovered by Ilya Vishnevsky.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.