4646import io .lettuce .core .api .push .PushListener ;
4747import io .lettuce .core .api .push .PushMessage ;
4848import io .lettuce .core .datastructure .queue .HashIndexedQueue ;
49- import io .lettuce .core .datastructure .queue .IncompleteQueue ;
5049import io .lettuce .core .internal .LettuceAssert ;
5150import io .lettuce .core .internal .LettuceSets ;
5251import io .lettuce .core .metrics .CommandLatencyRecorder ;
7069import io .netty .util .internal .logging .InternalLogLevel ;
7170import io .netty .util .internal .logging .InternalLogger ;
7271import io .netty .util .internal .logging .InternalLoggerFactory ;
72+ import net .bytebuddy .implementation .bytecode .Throw ;
7373
7474/**
7575 * A netty {@link ChannelHandler} responsible for writing redis commands and reading responses from the server.
@@ -161,11 +161,7 @@ public CommandHandler(ClientOptions clientOptions, ClientResources clientResourc
161161 this .commandLatencyRecorder = clientResources .commandLatencyRecorder ();
162162 this .latencyMetricsEnabled = commandLatencyRecorder .isEnabled ();
163163 this .boundedQueues = clientOptions .getRequestQueueSize () != Integer .MAX_VALUE ;
164- Queue <RedisCommand <?, ?, ?>> implementation = clientOptions .isUseHashIndexedQueue () ? new HashIndexedQueue <>()
165- : new ArrayDeque <>();
166- this .stack = new IncompleteQueue (implementation );
167-
168- // this.stack = clientOptions.isUseHashIndexedQueue() ? new HashIndexedQueue<>() : new ArrayDeque<>();
164+ this .stack = clientOptions .isUseHashIndexedQueue () ? new HashIndexedQueue <>() : new ArrayDeque <>();
169165
170166 Tracing tracing = clientResources .tracing ();
171167
@@ -664,8 +660,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Interrup
664660 return ;
665661 }
666662
667- } catch (Exception e ) {
668-
663+ } catch (Throwable e ) {
669664 ctx .close ();
670665 throw e ;
671666 }
@@ -690,8 +685,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Interrup
690685 decodeBufferPolicy .afterPartialDecode (buffer );
691686 return ;
692687 }
693- } catch (Exception e ) {
694-
688+ } catch (Throwable e ) {
695689 ctx .close ();
696690 throw e ;
697691 }
@@ -709,8 +703,9 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Interrup
709703 logger .debug ("{} Completing command {}" , logPrefix (), command );
710704 }
711705 complete (command );
712- } catch (Exception e ) {
706+ } catch (Throwable e ) {
713707 logger .warn ("{} Unexpected exception during request: {}" , logPrefix , e .toString (), e );
708+ command .completeExceptionally (e );
714709 }
715710 }
716711 }
0 commit comments