[SOLVED] Crash reporter - Captive Portal
-
Maybe the DDL command to check if the table exists is not a good ideia at this point.
On my "box", I added the code below in captiveportal.inc to check table_exists with a SELECT statement, so no lock is applied… and until now I got 40 connections without any errors.
$tableCheck = $DB->query("SELECT name FROM sqlite_master WHERE name='captiveportal'");
if ($tableCheck->fetchArray() === false)
{
if (! $DB->exec($createquery)) {...
-
Tables, database …. whatever.
If the file (which contains a 'sqllite3' database) is written out by another 'thread', it will be locked ....As an alternative, what out a simple wait for 1 millisecond 'usleep(1000)' ?
-
This is the root issue for the "Error message: database is locked. Resetting and trying again" and similar logs, we're looking into it.
https://redmine.pfsense.org/issues/5622 -
I running about 2 days without any erros ( crashes or locking logs ) with the use of busytimeout :
$DB->busyTimeout(5000);
if (! $DB->exec($createquery)) {
…"Sets a busy handler that will sleep until the database is not locked or the timeout is reached."
public bool SQLite3::busyTimeout ( int $msecs )reference: http://php.net/manual/en/sqlite3.busytimeout.php
I hope this is a good solution.
-
hi.
can you show exactly where you enter these parameters in captiveportal.inc
thanks
-
can you show exactly where you enter these parameters in captiveportal.inc
Look (Ctrl-F) for :
if (! $DB->exec($createquery)) {
;)
-
;D ;D
-
That one spot's probably adequate for the issue most are hitting, but it needs to be done in more than that spot. This should be the proper fix.
https://git.pfmechanics.com/pfsense/pfsense/commit/7c4b3b2060c291a9c166d8196d053afac97861afNext snapshot after the time of this post will have that.
-
New snapshots including that fix are out, please try and report back.
-
@cmb:
New snapshots including that fix are out, please try and report back.
On my "spot", i got about 120 simultaneous connections and it's working fine. I think it's solved, but could someone with big numbers give us more reports ?
Thanks
JC Bilhega