swim icon indicating copy to clipboard operation
swim copied to clipboard

Fixes stackoverflow in client. Refactors client interface to hide private API.

Open SirCipher opened this issue 4 years ago • 3 comments

SirCipher avatar Jan 19 '21 09:01 SirCipher

@SirCipher The change looks good. Do we have a test case that failed which got fixed due to this commit? If not, is there a way to reproduce the stackoverlow error?

ajay-gov avatar Jan 21 '21 21:01 ajay-gov

@SirCipher The change looks good. Do we have a test case that failed which got fixed due to this commit? If not, is there a way to reproduce the stackoverlow error?

@ajay-gov The stack overflow was swallowed and I only noticed it when debugging - opening a downlink and having breakpoint on the ClientRuntime::reportDown method. If you want to reproduce it, you'd need to change SwimClientRef::reportDown to report the metric: this.edge.reportDown(metric) and have a breakpoint there when opening a downlink.

SirCipher avatar Jan 22 '21 12:01 SirCipher

@SirCipher I see, thanks.

So the ClientRuntime.fail(message) gets invoked but it's not doing anything with it. Should we enhance the ClientRuntimeSpec to use an extended version of the ClienRuntime and override the didFail method. Something like this:

  class TestClientRuntime extends ClientRuntime {

    @Override
    public void fail(Object message) {
      failure = message;
  
  }

And then do the following assertion assertNull(failure, failure.toString()); after didSync.await(); That way we will have a failed test case that captures this issue?

ajay-gov avatar Jan 23 '21 01:01 ajay-gov

Will be addressed in swim5

ajay-gov avatar Apr 08 '23 18:04 ajay-gov