(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol)
| 25212 | } |
| 25213 | |
| 25214 | func (p *iClientRPCServiceProcessorRequestStatementId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 25215 | args := IClientRPCServiceRequestStatementIdArgs{} |
| 25216 | var err2 error |
| 25217 | if err2 = args.Read(ctx, iprot); err2 != nil { |
| 25218 | iprot.ReadMessageEnd(ctx) |
| 25219 | x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) |
| 25220 | oprot.WriteMessageBegin(ctx, "requestStatementId", thrift.EXCEPTION, seqId) |
| 25221 | x.Write(ctx, oprot) |
| 25222 | oprot.WriteMessageEnd(ctx) |
| 25223 | oprot.Flush(ctx) |
| 25224 | return false, thrift.WrapTException(err2) |
| 25225 | } |
| 25226 | iprot.ReadMessageEnd(ctx) |
| 25227 | |
| 25228 | tickerCancel := func() {} |
| 25229 | // Start a goroutine to do server side connectivity check. |
| 25230 | if thrift.ServerConnectivityCheckInterval > 0 { |
| 25231 | var cancel context.CancelFunc |
| 25232 | ctx, cancel = context.WithCancel(ctx) |
| 25233 | defer cancel() |
| 25234 | var tickerCtx context.Context |
| 25235 | tickerCtx, tickerCancel = context.WithCancel(context.Background()) |
| 25236 | defer tickerCancel() |
| 25237 | go func(ctx context.Context, cancel context.CancelFunc) { |
| 25238 | ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) |
| 25239 | defer ticker.Stop() |
| 25240 | for { |
| 25241 | select { |
| 25242 | case <-ctx.Done(): |
| 25243 | return |
| 25244 | case <-ticker.C: |
| 25245 | if !iprot.Transport().IsOpen() { |
| 25246 | cancel() |
| 25247 | return |
| 25248 | } |
| 25249 | } |
| 25250 | } |
| 25251 | }(tickerCtx, cancel) |
| 25252 | } |
| 25253 | |
| 25254 | result := IClientRPCServiceRequestStatementIdResult{} |
| 25255 | var retval int64 |
| 25256 | if retval, err2 = p.handler.RequestStatementId(ctx, args.SessionId); err2 != nil { |
| 25257 | tickerCancel() |
| 25258 | if err2 == thrift.ErrAbandonRequest { |
| 25259 | return false, thrift.WrapTException(err2) |
| 25260 | } |
| 25261 | x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing requestStatementId: " + err2.Error()) |
| 25262 | oprot.WriteMessageBegin(ctx, "requestStatementId", thrift.EXCEPTION, seqId) |
| 25263 | x.Write(ctx, oprot) |
| 25264 | oprot.WriteMessageEnd(ctx) |
| 25265 | oprot.Flush(ctx) |
| 25266 | return true, thrift.WrapTException(err2) |
| 25267 | } else { |
| 25268 | result.Success = &retval |
| 25269 | } |
| 25270 | tickerCancel() |
| 25271 | if err2 = oprot.WriteMessageBegin(ctx, "requestStatementId", thrift.REPLY, seqId); err2 != nil { |
nothing calls this directly
no test coverage detected