Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-695

Rpc future doesn't complete when transformer fails

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • Aluminium
    • Aluminium, Magnesium SR2
    • netconf
    • None

    Description

       

      When netconf message transformer fails to parse reply(e.g. because of https://jira.opendaylight.org/browse/NETCONF-645), result future is stuck and never completes.

      Following test proves the problem. It can be pasted to org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpcTest.

      @Test
      public void testDeadlock() throws Exception {
          // when rpc is successful, but transformer fails for some reason
          final MessageTransformer<NetconfMessage> failingTransformer = mock(MessageTransformer.class);
          final RemoteDeviceCommunicator<NetconfMessage> communicatorMock = mock(RemoteDeviceCommunicator.class);
          final NetconfMessage msg = null;
          final RpcResult<NetconfMessage> result = RpcResultBuilder.success(msg).build();
          when(communicatorMock.sendRequest(any(), any())).thenReturn(Futures.immediateFuture(result));
          when(failingTransformer.toRpcResult(any(), any())).thenThrow(new RuntimeException("FAIL"));
          final NetconfDeviceRpc rpc = new NetconfDeviceRpc(SCHEMA_CONTEXT, communicatorMock, failingTransformer);
          // then guava logs and swallow exception and future never completes
          rpc.invokeRpc(path, null).get();
      }

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jluhrsen Jamo Luhrsen
              andmak Andrej Mak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: