Skip to content

Small thread stack configured for mysql container #347

Closed

Description

@iNikem

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?

Activity

  1. iNikem commented on May 27, 2017

    @iNikem
    ContributorAuthor

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

  2. rnorth commented on May 27, 2017

    @rnorth
    Member

    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

  3. added this to the 1.3.0 milestone on May 29, 2017
  4. self-assigned this
    on Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions