close Warning: Can't synchronize with repository "keplertools" (/srv/svn/keplertools does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

#1 closed Defekt (erledigt)

MySQL-Bindings not threadsafe

Reported by: Rüdiger Kupper Owned by: Rüdiger Kupper
Priority: schnell erledigen Milestone:
Component: Webdienst: Trac (Tickets) Severity:
Keywords: Cc: bau

Description (last modified by admin)

The about Page reports that the MySQL-Bindings are not thread-safe. According to the Trac Installation guide, this is bad.

This should be cared for.

Change History (5)

comment:1 by admin, 15 years ago

Description: modified (diff)

comment:2 by admin, 15 years ago

Description: modified (diff)

comment:3 by admin, 15 years ago

Priority: major → critical

comment:4 by Rüdiger Kupper, 15 years ago

Cc: bau added
Status: new → accepted

Die Python-Bindings sind tatsächlich thread-safe kompiliert, wie der Test unter ​trac:MySqlDb#thread-safetyisimportant zeigt:

17:34/0 [kup@paedml] ~ $ python -c "import MySQLdb; print(MySQLdb.thread_safe());"
1

Das Problem ist also offenbar, dass das Apache-Modul im nicht-threadsicheren Modus läuft, wie in ​trac:MySqlDb#thread-safetyisimportant beschrieben.

comment:5 by Rüdiger Kupper, 15 years ago

Resolution: → fixed
Status: accepted → closed

Lösung

Wie in ​trac:MySqlDb#thread-safetyisimportant vorgeschlagen, habe ich in /usr/lib/ die nicht-threadsicheren Files (ohne "_r" im Filenamen) durch symbolische Links zu den threadsicheren Varianten (mit "_r" im Filenamen) ersetzt:

18:41/0 paedml /usr/lib # ls -l /usr/lib/libmysqlclient*
lrwxrwxrwx 1 root root      18 Jul 17 18:16 /usr/lib/libmysqlclient.a -> libmysqlclient_r.a
lrwxrwxrwx 1 root root      19 Jul 17 18:17 /usr/lib/libmysqlclient.la -> libmysqlclient_r.la
lrwxrwxrwx 1 root root      19 Jul 17 18:18 /usr/lib/libmysqlclient.so -> libmysqlclient_r.so
lrwxrwxrwx 1 root root      22 Jul 17 18:29 /usr/lib/libmysqlclient.so.15 -> libmysqlclient_r.so.15
lrwxrwxrwx 1 root root      26 Jul 17 18:29 /usr/lib/libmysqlclient.so.15.0.0 -> libmysqlclient_r.so.15.0.0
-rw-r--r-- 1 root root 2609092 Feb 12  2010 /usr/lib/libmysqlclient_r.a
-rw-r--r-- 1 root root     995 Feb 12  2010 /usr/lib/libmysqlclient_r.la
lrwxrwxrwx 1 root root      22 Jul  9 16:45 /usr/lib/libmysqlclient_r.so -> libmysqlclient_r.so.15
lrwxrwxrwx 1 root root      26 Apr 20  2010 /usr/lib/libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
-rw-r--r-- 1 root root 1941136 Feb 12  2010 /usr/lib/libmysqlclient_r.so.15.0.0

Die about-Seite zeigt jetzt an, dass die Python-Bindings im threadsicheren Modus laufen.

Wiederherstellen

Kopien der ursprünglichen Files finden sich in /usr/lib/libmysqlclient-copy/.

Note: See TracTickets for help on using tickets.