sinnbeck
sinnbeck

René Sinnbeck

@sinnbeck

Laravel dev from Denmark

29 Posts 55 Views

  • No matching results...
  • Searching...

/ 255

In response to @ozdemiru

There is yes. It is the second job added to the queue. The first one runs as expected..

---TRANSACTION 4377655, ACTIVE 40 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 1128, 1 row lock(s)
MySQL thread id 26, OS thread handle 139871028414208, query id 2093 172.20.0.5 foo Updating
UPDATE jobs SET reserved_at = '1726473640' WHERE id = '158'

1

9

In response to @sinnbeck

It seems that it runs the first job as expected. The queue is now empty. I then add a new job, and this locks it up..

| 26 | foo | 172.20.0.5:49924 | foo | Query   |   25 | Updating                 | UPDATE jobs SET reserved_at = '1726473536' WHERE id = '158' |    0.000 |

5

In response to @ozdemiru

Thanks for the input!

Yeah it kinda feels that way. It sounds like you are understanding correctly.

I honestly just dont understand why the commit isn't releasing it. I have AUTOCOMMIT on and I also run ->commit() on pdo (dba is just a wrapper around pdo)

    public function transaction(Closure $callback)
{
$this->dba->beginTransaction();
try {
$result = $callback();

if ($this->dba->inTransaction()) {
$this->dba->commit();

}

return $result;
} catch (Exception) {
$this->dba->rollBack();
return null;
}

}

As far as I can tell Laravel use 'FOR UPDATE` as well, and does not lock up..

I am running MariaDB version 10.3.31

2

12