Giter VIP home page Giter VIP logo

go-database-sql-issue's Introduction

go-database-sql-issue

Ways to reproduce the issue in linux machine

  1. add packet latency to simulate the host to db cross region latency
sudo tc qdisc add dev lo root netem delay 60ms
  1. run this code using
go run main.go
  1. once things stabilize, check connection number from postgresql side with psql
SELECT sum(numbackends) FROM pg_stat_database;
  1. inject packet loss between host and db to simulate network blip
sudo iptables -A OUTPUT -p tcp --dport 5432 -m statistic --mode random --probability 0.5 -j DROP
  1. remove packet loss event in iptables supposing added rule index was 1
sudo iptables -D OUTPUT 1
  1. observe that things never recover until restarted
  2. check connection number from db side with psql again

go-database-sql-issue's People

Contributors

xshipeng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.