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

Small thread stack configured for mysql container #347

Closed
iNikem opened this issue May 27, 2017 · 2 comments
Closed

Small thread stack configured for mysql container #347

iNikem opened this issue May 27, 2017 · 2 comments
Assignees
Milestone

Comments

@iNikem
Copy link
Contributor

iNikem commented May 27, 2017

MySQL testcontainer has a my.cnf override which, among other things, sets thread_stack = 128K. This leads to the following problem:

Caused by: java.sql.SQLException: Thread stack overrun:  7704 bytes used of a 131072 byte stack, and 128000 bytes needed.  Use 'mysqld --thread_stack=#' to specify a bigger stack.
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
	at org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:238)
	at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:114)
	... 53 more

This SO thread can be of help: https://stackoverflow.com/questions/8821575/mysql-error-1436-thread-stack-overrun-with-simple-query .
Providing local my.cnf override with thread_stack = 256K solves the problem.

Why mysql testcontainer needs my.cnf at all? Shouldn't the default configuration of MySQL be good enough?

@iNikem
Copy link
Contributor Author

iNikem commented May 27, 2017

Providing withConfigurationOverride with empty my.cnf file removes the problem as well.

@rnorth
Copy link
Member

rnorth commented May 27, 2017

Hi @iNikem
We have a default my.cnf file to reduce the memory footprint of the MySQL container; the original defaults are quite memory hungry and we found that this was causing unreliability in hard to debug ways (see #209 and #243)

I suspect the thread_stack setting could be an overoptimization though, and something we can change.
Thanks for reporting this
Richard

@bsideup bsideup added this to the 1.3.0 milestone May 29, 2017
@rnorth rnorth self-assigned this Jun 4, 2017
rnorth added a commit that referenced this issue Jun 4, 2017
The default value has now been removed to allow DB default to be used (typically 192K)
Refs #347
@bsideup bsideup closed this as completed in 1c1bf42 Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants