(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol)
| 22131 | } |
| 22132 | |
| 22133 | func (p *iClientRPCServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 22134 | args := IClientRPCServiceExecuteStatementArgs{} |
| 22135 | var err2 error |
| 22136 | if err2 = args.Read(ctx, iprot); err2 != nil { |
| 22137 | iprot.ReadMessageEnd(ctx) |
| 22138 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) |
| 22139 | oprot.WriteMessageBegin(ctx, "executeStatement", thrift.EXCEPTION, seqId) |
| 22140 | x.Write(ctx, oprot) |
| 22141 | oprot.WriteMessageEnd(ctx) |
| 22142 | oprot.Flush(ctx) |
| 22143 | return false, thrift.WrapTException(err2) |
| 22144 | } |
| 22145 | iprot.ReadMessageEnd(ctx) |
| 22146 | |
| 22147 | tickerCancel := func() {} |
| 22148 | // Start a goroutine to do server side connectivity check. |
| 22149 | if thrift.ServerConnectivityCheckInterval > 0 { |
| 22150 | var cancel context.CancelFunc |
| 22151 | ctx, cancel = context.WithCancel(ctx) |
| 22152 | defer cancel() |
| 22153 | var tickerCtx context.Context |
| 22154 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) |
| 22155 | defer tickerCancel() |
| 22156 | go func(ctx context.Context, cancel context.CancelFunc) { |
| 22157 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) |
| 22158 | defer ticker.Stop() |
| 22159 | for { |
| 22160 | select { |
| 22161 | case <-ctx.Done(): |
| 22162 | return |
| 22163 | case <-ticker.C: |
| 22164 | if !iprot.Transport().IsOpen() { |
| 22165 | cancel() |
| 22166 | return |
| 22167 | } |
| 22168 | } |
| 22169 | } |
| 22170 | }(tickerCtx, cancel) |
| 22171 | } |
| 22172 | |
| 22173 | result := IClientRPCServiceExecuteStatementResult{} |
| 22174 | var retval *TSExecuteStatementResp |
| 22175 | if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { |
| 22176 | tickerCancel() |
| 22177 | if err2 == thrift.ErrAbandonRequest { |
| 22178 | return false, thrift.WrapTException(err2) |
| 22179 | } |
| 22180 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeStatement: " + err2.Error()) |
| 22181 | oprot.WriteMessageBegin(ctx, "executeStatement", thrift.EXCEPTION, seqId) |
| 22182 | x.Write(ctx, oprot) |
| 22183 | oprot.WriteMessageEnd(ctx) |
| 22184 | oprot.Flush(ctx) |
| 22185 | return true, thrift.WrapTException(err2) |
| 22186 | } else { |
| 22187 | result.Success = retval |
| 22188 | } |
| 22189 | tickerCancel() |
| 22190 | if err2 = oprot.WriteMessageBegin(ctx, "executeStatement", thrift.REPLY, seqId); err2 != nil { |
nothing calls this directly
no test coverage detected