Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client IceProtocolConnection to schedule first heartbeat only … #4115

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

bernardnormier
Copy link
Member

…once connected

This is a small fix to the "send heartbeat" logic in IceProtocolConnection.

Prior to this PR, an Ice client connection could send heartbeats before receiving the initial ValidateConnection frame from the server. That's a minor violation of the ice protocol that neither Ice nor IceRPC would detect. It's also very unlikely. Nevertheless, a small bug.

I also added a test to verify that an ice client connection that doesn't write anything is not aborted by the server connection idle monitor.

@bernardnormier bernardnormier marked this pull request as draft December 18, 2024 20:30
@bernardnormier
Copy link
Member Author

On macos CI, the new test failed with:

  Failed IceRpc:Tests:IceProtocolConnectionTests:Server_idle_monitor_does_not_abort_connection_when_client_does_not_write_anything [530 ms]
  Error Message:
     Assert.That(serverShutdownRequested.IsCompleted, Is.False)
  Expected: False
  But was:  True

  Stack Trace:
     at IceRpc.Tests.IceProtocolConnectionTests.Server_idle_monitor_does_not_abort_connection_when_client_does_not_write_anything() in /Users/runner/work/icerpc-csharp/icerpc-csharp/tests/IceRpc.Tests/IceProtocolConnectionTests.cs:line 580
   at IceRpc.Tests.IceProtocolConnectionTests.Server_idle_monitor_does_not_abort_connection_when_client_does_not_write_anything() in /Users/runner/work/icerpc-csharp/icerpc-csharp/tests/IceRpc.Tests/IceProtocolConnectionTests.cs:line 586
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](Func`1 invoke)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass3_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)

1)    at IceRpc.Tests.IceProtocolConnectionTests.Server_idle_monitor_does_not_abort_connection_when_client_does_not_write_anything() in /Users/runner/work/icerpc-csharp/icerpc-csharp/tests/IceRpc.Tests/IceProtocolConnectionTests.cs:line 580

530 ms is quite long. Maybe an 100 ms idle timeout is too short, especially since the fixture runs the tests in parallel.

@bernardnormier bernardnormier marked this pull request as ready for review December 19, 2024 13:37
@bernardnormier bernardnormier merged commit fc251d6 into icerpc:main Dec 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants