Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL connections kept open #99

Open
uint opened this issue Nov 28, 2017 · 0 comments
Open

SQL connections kept open #99

uint opened this issue Nov 28, 2017 · 0 comments

Comments

@uint
Copy link

uint commented Nov 28, 2017

It looks like SQL connections are kept open when using a dbi-store for session data storage. This might be related to #98, maybe?

Steps to reproduce:

  1. Set up a MySQL server.
  2. Follow the instructions in the Using session section of README.markdown.
  3. Create a sessions table in your DB. Otherwise you'll get an error about it. This worked for me:
CL-USER> (datafly.db:connect-toplevel :mysql :database-name "test" :username "root" :password "bleh")
#<DBD.MYSQL:<DBD-MYSQL-CONNECTION> {1004C22513}>
CL-USER> (datafly.db:execute (sxql:create-table :sessions ((id :type '(:int 20) :primary-key t :unique t) (session_data :type '(:varchar 2048) :not-null nil :default nil))))
; No value
CL-USER> (datafly.db:disconnect-toplevel)
NIL
  1. Start your server.
  2. Open any served page in your browser ~75 times, which is probably the default for allowed connections in MySQL.

After that, every following request is met with:

MySQL error: "Too many connections" (errno = 1040).
   [Condition of type COM.HACKINGHAT.CL-MYSQL-SYSTEM:MYSQL-ERROR]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant