Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-4092

Router causes infinite recursion under certain rare conditions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.6, 3.2.1, 3.2.0, 3.1.0, 2.8.2, 2.6.3
    • Fix Version/s: 3.3.0, 3.2.2, 3.0.6, 2.8.3
    • Component/s: Router
    • Labels:
      None
    • Release Notes:
      Fixes an issue that causes worker threads to go into an infinite recursion while exceptions are being thrown in channel handlers.
    • Rank:
      1|hzz293:

      Description

      Router worker thread could end up in an infinite stack trace and fill up the disk in some scenarios where the channel is not closed and when there are exceptions in channels.write call. The side effect of this will be one or more worker thread will be tied up in the infinite recursion and the disks will fill up. The following code fragment is responsible for the call.

        LOG.error("Exception raised in Request Handler {}", ctx.getChannel(), cause);
          if (ctx.getChannel().isConnected() && !channelClosed) {
            HttpResponse response = (cause instanceof HandlerException) ?
                                    ((HandlerException) cause).createFailureResponse() :
                                    new DefaultHttpResponse(HttpVersion.HTTP_1_1,
                                                            HttpResponseStatus.INTERNAL_SERVER_ERROR);
              Channels.write(ctx, e.getFuture(), response);
              e.getFuture().addListener(ChannelFutureListener.CLOSE);
          }
        }
      

      The fix is to detect the recursed call and not calling Channels.write during recursion.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ali.anwar Ali Anwar
                Reporter:
                sree Sreevatsan Raman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: