Commit 80e14f5b authored by heikki@hundin.mysql.fi's avatar heikki@hundin.mysql.fi
Browse files

os0thread.h, srv0srv.c:

  Increase max number of waiting threads to 10000 and put diagnostic prints if this value is exceeded
parent dfc866b3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -12,8 +12,10 @@ Created 9/8/1995 Heikki Tuuri

#include "univ.i"

/* Maximum number of threads which can be created in the program */
#define	OS_THREAD_MAX_N		1000
/* Maximum number of threads which can be created in the program;
this is also the size of the wait slot array for MySQL threads which
can wait inside InnoDB */
#define	OS_THREAD_MAX_N		10000

/* Possible fixed priorities for threads */
#define OS_THREAD_PRIORITY_NONE		100
+25 −1
Original line number Diff line number Diff line
@@ -2001,7 +2001,31 @@ srv_table_reserve_slot_for_mysql(void)

	while (slot->in_use) {
		i++;
		ut_a(i < OS_THREAD_MAX_N);

		if (i >= OS_THREAD_MAX_N) {

		        ut_print_timestamp(stderr);

		        fprintf(stderr,
"  InnoDB: There appear to be %lu MySQL threads currently waiting\n"
"InnoDB: inside InnoDB, which is the upper limit. Cannot continue operation.\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
"InnoDB: on Linux. But first we print a list of waiting threads.\n", i);

			for (i = 0; i < OS_THREAD_MAX_N; i++) {

			        slot = srv_mysql_table + i;

			        fprintf(stderr,
"Slot %lu: thread id %lu, type %lu, in use %lu, susp %lu, time %lu\n",
				  i, (ulint)(slot->id),
				  slot->type, slot->in_use,
				  slot->suspended,
			  (ulint)difftime(ut_time(), slot->suspend_time));
			}

		        ut_a(0);
		}
		
		slot = srv_mysql_table + i;
	}