diff --git a/lib/bouncer/bouncers/v2/bouncer.go b/lib/bouncer/bouncers/v2/bouncer.go index b0663bb1f21a8c7c06660548788af6d5d7cb758c..eb315f5452066c42d86a73b6d50086de41254bc3 100644 --- a/lib/bouncer/bouncers/v2/bouncer.go +++ b/lib/bouncer/bouncers/v2/bouncer.go @@ -5,7 +5,6 @@ import ( "pggat2/lib/bouncer/bouncers/v2/bctx" "pggat2/lib/bouncer/bouncers/v2/berr" - "pggat2/lib/bouncer/bouncers/v2/rclient" "pggat2/lib/bouncer/bouncers/v2/rserver" "pggat2/lib/perror" "pggat2/lib/zap" @@ -269,9 +268,7 @@ func Bounce(client, server zap.ReadWriter) { } case berr.Server: serverError(&ctx, e) - if err2 := rclient.Recover(&ctx); err2 != nil { - clientError(&ctx, err2) - } + clientError(&ctx, e) default: panic("unreachable") } diff --git a/lib/bouncer/bouncers/v2/rclient/recoverer.go b/lib/bouncer/bouncers/v2/rclient/recoverer.go deleted file mode 100644 index 60adb2f4092347c4d1730ed611f62f99e6d714d3..0000000000000000000000000000000000000000 --- a/lib/bouncer/bouncers/v2/rclient/recoverer.go +++ /dev/null @@ -1,34 +0,0 @@ -package rclient - -import "pggat2/lib/bouncer/bouncers/v2/bctx" - -func Recover(ctx *bctx.Context) error { - // TODO(garet) I actually don't know if I have to obey the client's expectations when it comes to Txs - // We are just going to break out without letting the client tell us to. This might lead to app crashes, - // but if a database is crashing or behaving badly, you can't really expect any better behavior - if inCopyIn { - // TODO(garet) wait until client sends CopyDone or CopyFail - } - if inCopyOut { - // TODO(garet) send ErrorResponse("server failed") - } - if inQuery { - // TODO(garet) send ErrorResponse("server failed") - // TODO(garet) send ReadyForQuery('I') - } - if inFunctionCall { - // TODO(garet) send ErrorResponse("server failed") - // TODO(garet) send ReadyForQuery('I') - } - if inSync { - // TODO(garet) send ErrorResponse("server failed") - // TODO(garet) send ReadyForQuery('I') - } - if inEQP { - // TODO(garet) discard until Sync and then send error and ReadyForQuery('I') - } - if ctx.TxState != 'I' { - // TODO(garet) wait for next packet and then handle it, sending error and ReadyForQuery('I') - } - return nil -}