Closed MRSorokinMaxim closed 2 years ago
A promise is a SwiftNIO type which allows a value to be provided in the future. A promise leaks when it deinits without a value ever being provided to it.
I suspect this happens as a result of not shutting down the connection when the app is sent to the background.
Do you think you could try this using a MultiThreadedEventLoopGroup
(instead of PlatformSupport.makeEventLoopGroup
) and compiled for debug? That should tell us where the promise was created and we can figure out whether this is a bug or not.
I try using Multithreadeventloopgroup(numberOfThreads: 1)
and get below logs. I don't more get the crash "Precondition failed: leaking an unfulfilled Promise". But I don't understand well next message from logs. Are you see something problems?
If I have a lot of streams as ServerStreamingCall
and BidirectionalStreamingCall
in app, also have many unaryCall
, what do i should use EventLoopGroup
in app?
Application is active with below logs
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : old_state=idle new_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity state change
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : connectivity_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 creating a ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : connectivity_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : new_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 old_state=idle connectivity state change
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : connectivity_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 creating a ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=connecting vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : connectivity_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=connecting vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : connectivity_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=connecting vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 delay=1.0 scheduling connection attempt
2022-03-23T18:36:26+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/0 new_state=transientFailure old_state=connecting connectivity state change
2022-03-23T18:36:26+0300 debug debug-gRPC-logger : old_state=idle grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 new_state=connecting connectivity state change
2022-03-23T18:36:26+0300 debug debug-gRPC-logger : connectivity_state=connecting grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 vending multiplexer future
2022-03-23T18:36:26+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:26+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 creating a ClientBootstrap
2022-03-23T18:36:26+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=connecting vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=connecting activating connection
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : connectivity_state=connecting grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 activating connection
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 TLS handshake completed, negotiated protocol: h2
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : h2_settings_max_concurrent_streams=128 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 h2_settings_max_frame_size=16777215 h2_settings_initial_window_size=65536 HTTP2 settings update
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : connectivity_state=active grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connection ready
g debug-Stream-gRPC-logger : old_state=connecting grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 new_state=ready connectivity state change
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 TLS handshake completed, negotiated protocol: h2
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_settings_max_frame_size=16777215 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 h2_settings_max_concurrent_streams=128 h2_settings_initial_window_size=65536 grpc.conn.addr_local=192.168.0.101 HTTP2 settings update
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : connectivity_state=active grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 connection ready
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : old_state=connecting grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 new_state=ready connectivity state change
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(1) h2_active_streams=1 grpc.conn.addr_local=192.168.0.101 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(1) grpc.conn.addr_remote=88.198.110.34 h2_active_streams=1 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : h2_stream_id=HTTP2StreamID(3) grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=2 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc.conn.addr_remote=88.198.110.34 grpc.conn.addr_local=192.168.0.101 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_stream_id=HTTP2StreamID(5) h2_active_streams=3 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : h2_active_streams=4 grpc.conn.addr_local=192.168.0.101 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(7) HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_active_streams=5 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(9) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : h2_active_streams=6 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(11) HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc.conn.addr_remote=88.198.110.34 grpc.conn.addr_local=192.168.0.101 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_active_streams=7 h2_stream_id=HTTP2StreamID(13) HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-Stream-gRPC-logger : grpc.conn.addr_local=192.168.0.101 h2_active_streams=8 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_stream_id=HTTP2StreamID(15) HTTP2 stream created
ug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(3) h2_active_streams=2 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_stream_id=HTTP2StreamID(5) grpc.conn.addr_remote=88.198.110.34 grpc.conn.addr_local=192.168.0.101 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 h2_active_streams=3 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc.conn.addr_local=192.168.0.101 h2_active_streams=4 h2_stream_id=HTTP2StreamID(7) grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_remote=88.198.110.34 HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_stream_id=HTTP2StreamID(1) grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 h2_active_streams=3 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 HTTP2 stream closed
debug-gRPC-logger : connectivity_state=ready grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_active_streams=4 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(9) HTTP2 stream created
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_active_streams=3 grpc.conn.addr_local=192.168.0.101 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 h2_stream_id=HTTP2StreamID(3) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(5) grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=2 HTTP2 stream closed
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_remote=88.198.110.34 h2_active_streams=1 h2_stream_id=HTTP2StreamID(9) grpc.conn.addr_local=192.168.0.101 HTTP2 stream closed
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_stream_id=HTTP2StreamID(7) grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 h2_active_streams=0 HTTP2 stream closed
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : connectivity_state=ready grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 vending multiplexer future
2022-03-23T18:36:27+0300 debug debug-gRPC-logger : h2_active_streams=1 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(11) grpc.conn.addr_local=192.168.0.101 HTTP2 stream created
23T18:36:27+0300 debug debug-gRPC-logger : grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 h2_active_streams=0 grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 h2_stream_id=HTTP2StreamID(11) HTTP2 stream closed
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : old_state=transientFailure new_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 connectivity state change
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 creating a ClientBootstrap
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 delay=1.7686852620833287 scheduling connection attempt
2022-03-23T18:36:27+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/1 new_state=transientFailure old_state=connecting connectivity state change
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 new_state=connecting old_state=transientFailure connectivity state change
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 creating a ClientBootstrap
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : delay=2.6773723473316022 grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 scheduling connection attempt
2022-03-23T18:36:29+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/2 old_state=connecting new_state=transientFailure connectivity state change
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 new_state=connecting old_state=transientFailure connectivity state change
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 creating a ClientBootstrap
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : delay=3.334592897328564 grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 scheduling connection attempt
2022-03-23T18:36:32+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/3 new_state=transientFailure old_state=connecting connectivity state change
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : new_state=connecting old_state=transientFailure grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 connectivity state change
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 creating a ClientBootstrap
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 delay=7.590826216111899 scheduling connection attempt
2022-03-23T18:36:35+0300 debug debug-core-gRPC-logger : new_state=transientFailure old_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/4 connectivity state change
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 old_state=transientFailure new_state=connecting connectivity state change
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 creating a ClientBootstrap
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : delay=11.631651665888704 grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 scheduling connection attempt
2022-03-23T18:36:43+0300 debug debug-core-gRPC-logger : new_state=transientFailure old_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/5 connectivity state change
2022-03-23T18:36:54+0300 debug debug-core-gRPC-logger : new_state=connecting grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 old_state=transientFailure connectivity state change
2022-03-23T18:36:54+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:36:54+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:36:54+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 creating a ClientBootstrap
2022-03-23T18:36:55+0300 debug debug-core-gRPC-logger : delay=14.95366439495162 grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 scheduling connection attempt
2022-03-23T18:36:55+0300 debug debug-core-gRPC-logger : new_state=transientFailure grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/6 old_state=connecting connectivity state change
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 new_state=connecting old_state=transientFailure connectivity state change
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 creating a ClientBootstrap
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 delay=28.52495883706588 scheduling connection attempt
2022-03-23T18:37:09+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/7 new_state=transientFailure old_state=connecting connectivity state change
Application will resign active we invoke cancel(promise: null) with below logs
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : h2_active_streams=7 grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(5) grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : h2_active_streams=6 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(1) HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=5 h2_stream_id=HTTP2StreamID(3) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=4 h2_stream_id=HTTP2StreamID(7) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=3 h2_stream_id=HTTP2StreamID(13) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=2 h2_stream_id=HTTP2StreamID(9) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=1 h2_stream_id=HTTP2StreamID(11) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
2022-03-23T18:39:11+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_stream_id=HTTP2StreamID(15) h2_active_streams=0 grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 HTTP2 stream closed
Application becomes active with below logs
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 old_state=transientFailure new_state=connecting connectivity state change
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 making client bootstrap with event loop group of type SelectableEventLoop
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 Network.framework is available but the EventLoopGroup is not compatible with NIOTS, falling back to ClientBootstrap
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 creating a ClientBootstrap
2022-03-23T18:40:07+0300 debug debug-gRPC-logger : grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 connectivity_state=ready idling connection
2022-03-23T18:40:07+0300 debug debug-gRPC-logger : old_state=ready grpc_connection_id=D42E1FAE-8DF5-41D9-AF00-034A04A18BFC/0 new_state=idle connectivity state change
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : delay=119.15227931211354 grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 scheduling connection attempt
2022-03-23T18:40:07+0300 debug debug-core-gRPC-logger : new_state=transientFailure grpc_connection_id=FBE371A9-DA7D-415C-A31E-41CC8FA9F7AE/10 old_state=connecting connectivity state change
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(17) grpc.conn.addr_remote=88.198.110.34 h2_active_streams=1 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : connectivity_state=ready grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : connectivity_state=ready grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : connectivity_state=ready grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 connectivity_state=ready vending multiplexer future
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : h2_active_streams=2 h2_stream_id=HTTP2StreamID(19) grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_remote=88.198.110.34 h2_stream_id=HTTP2StreamID(21) h2_active_streams=3 grpc.conn.addr_local=192.168.0.101 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : h2_stream_id=HTTP2StreamID(23) grpc.conn.addr_remote=88.198.110.34 grpc.conn.addr_local=192.168.0.101 h2_active_streams=4 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_active_streams=5 h2_stream_id=HTTP2StreamID(25) grpc.conn.addr_remote=88.198.110.34 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc.conn.addr_remote=88.198.110.34 h2_active_streams=6 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_stream_id=HTTP2StreamID(27) grpc.conn.addr_local=192.168.0.101 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc.conn.addr_local=192.168.0.101 grpc.conn.addr_remote=88.198.110.34 grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 h2_stream_id=HTTP2StreamID(29) h2_active_streams=7 HTTP2 stream created
2022-03-23T18:40:07+0300 debug debug-Stream-gRPC-logger : grpc_connection_id=1A2F3268-7393-433B-86FC-7A335627D421/0 grpc.conn.addr_local=192.168.0.101 h2_stream_id=HTTP2StreamID(31) h2_active_streams=8 grpc.conn.addr_remote=88.198.110.34 HTTP2 stream created
Also we noticed one of feature of the work using a PlatformSupport.makeEventLoopGroup that we connected only one stream crash is don't appear more.
I try using
Multithreadeventloopgroup(numberOfThreads: 1)
and get below logs. I don't more get the crash "Precondition failed: leaking an unfulfilled Promise".
Thanks, that's a bit annoying, I was hoping it would still crash and we'd be able to see which promise was leaking.
But I don't understand well next message from logs. Are you see something problems?
The only thing of note is that the connection seems to be bouncing between transient_failure
and connecting
.
If I have a lot of streams as
ServerStreamingCall
andBidirectionalStreamingCall
in app, also have manyunaryCall
, what do i should useEventLoopGroup
in app?
Use PlatformSupport.makeEventLoopGroup
; I only suggested MultiThreadedEventLoopGroup
because it has more diagnostics.
Did you try shutting down your connection and event loop group when the app goes to the background?
I'm experiencing a similar issue. In my case I traced the leaking promise back to scheduleTimeout
in ConnectionPool+Waiter.swift
. I'm not very familiar with this code but looks to me like the task should be getting stored in self._scheduledTimeout
but it is currently not which causes the promise to be deinitialized before it can be resolved.
I'm experiencing a similar issue. In my case I traced the leaking promise back to
scheduleTimeout
inConnectionPool+Waiter.swift
. I'm not very familiar with this code but looks to me like the task should be getting stored inself._scheduledTimeout
but it is currently not which causes the promise to be deinitialized before it can be resolved.
Ah, that's a really good spot, thanks! We should definitely be storing that _scheduledTimout
. I don't think that's the issue here though: the promise associated with the scheduled task should retained until the task is run (regardless of whether we are storing the scheduled task or not).
I think -- given that this doesn't reproduce with MultiThreadedEventLoopGroup
-- that we're hitting https://github.com/apple/swift-nio-transport-services/pull/138 which was released in 1.11.4. However, it looks like the most recent Cocoapod is 1.11.3.
@MRSorokinMaxim and @pveerina, are you using Cocapods?
Update: a 1.11.4 pod has been released.
Ah ok that sounds right, I am using cocoapods. Thanks for the update!
Problem was solved updating cocoapods. Thanks for the update!
When application will resign active we invoke "cancel(promise: null)" method for any gRPC call as UnaryCall or BidirectionalStreamingCall. And after application becomes active I always get crash of precondition "leaking an unfulfilled Promise". What is it means?
Application is active with below logs
Application will resign active we invoke cancel(promise: null) with below logs
Application becomes active with below logs
Xcode 12.5.1 iOS 14.7.1