ice icon indicating copy to clipboard operation
ice copied to clipboard

Simplify ACM

Open bernardnormier opened this issue 2 years ago • 3 comments

ACM in Ice 3.7 and earlier releases is too complicated, with too many options to compose.

We implemented a much simpler ACM (not called ACM) in IceRPC for the ice protocol, see:

https://github.com/icerpc/icerpc-csharp/blob/89a7a8466c37b2d1bcf2f8c7cd593cbf7df14757/src/IceRpc/ConnectionOptions.cs#L27

We should port this design to Ice.

In particular, IceRPC makes a distinction between idle and inactive, and we should do the same in Ice.

  • idle = bad, the connection is sick or misconfigured
  • inactive = all good, it just happens that the connection remains unused for a while

See https://github.com/icerpc/icerpc-csharp/blob/89a7a8466c37b2d1bcf2f8c7cd593cbf7df14757/src/IceRpc/ConnectionOptions.cs#L35 https://github.com/icerpc/icerpc-csharp/blob/89a7a8466c37b2d1bcf2f8c7cd593cbf7df14757/src/IceRpc/ConnectionOptions.cs#L46

bernardnormier avatar Sep 14 '23 21:09 bernardnormier

Proposal

  1. Remove all Ice.ACM and ObjectAdapter.ACM properties and replace them with:
Ice.IdleTimeout  # corresponds to IceIdleTimeout in IceRPC, with same default (60 seconds)
Ice.InactivityTimeout # corresponds to InactivityTimeout in IceRPC, with same default (5 * 60 seconds)
Ice.EnableIdleCheck # corresponds to EnableIdleCheck in IceRPC, with same default (false) for interop with Ice 3.7

These properties apply to all connections (client and server). You can override these properties for a specific object adapter with adapter.IdleTimeout etc.

  1. Update local interface Connection as follows. See https://doc.zeroc.com/ice/3.7/client-server-features/connection-management/using-connections
    local interface Connection
    {
       ... this proposal changes only ACM related operations ...
        void setCloseCallback(CloseCallback callback); // no change
        void setHeartbeatCallback(HeartbeatCallback callback); // no change
        
        // Remove setACM / getACM and timeout
       
        // New operations; all the timeouts are in seconds.
        int getIdleTimeout();
        void setIdleTimeout(int timeout);

        int getInactivityTimeout();
        void setInactivityTimeout(int timeout);

        bool isIdleCheckEnabled();
        void disableIdleCheck();
        void enableIdleCheck();    
    }
  1. Change the logic to be like IceRPC, in particular:
  • send pings every idle timeout / 2 unless there is some other write activity
  • local write activity (including pings) does not prevent the connection from becoming idle locally (idle => abort connection when EnableIdleCheck is true)

bernardnormier avatar Sep 15 '23 16:09 bernardnormier

Ice.IdleTimeout # corresponds to IceIdleTimeout in IceRPC, with same default (60 seconds)

According to https://docs.icerpc.dev/icerpc/slic-transport/connection-idle-timeout

The default idle timeout is 30 seconds.

EDIT: Never mind, I was looking at SLIC.

externl avatar Apr 03 '24 16:04 externl

The relevant page in IceRPC C# is: https://docs.icerpc.dev/api/csharp/api/IceRpc.ConnectionOptions.html#IceRpc_ConnectionOptions_IceIdleTimeout

bernardnormier avatar Apr 03 '24 21:04 bernardnormier

Implemented in all languages.

bernardnormier avatar Jul 18 '24 20:07 bernardnormier