luckyframework / luckyframework/breeze

deadlock detected

Open
#29 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
22
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I went to run specs on my app locally, and I got a ton of deadlock errors:

```
Unhandled exception in spawn: deadlock detected (PQ::PQError)
from lib/pg/src/pq/connection.cr:203:7 in 'handle_error'
from lib/pg/src/pq/connection.cr:186:7 in 'handle_async_frames'
from lib/pg/src/pq/connection.cr:162:7 in 'read'
from lib/pg/src/pq/connection.cr:414:18 in 'expect_frame'
from lib/pg/src/pq/connection.cr:398:9 in 'read_next_row_start'
from lib/pg/src/pg/result_set.cr:39:8 in 'move_next'
from lib/db/src/db/result_set.cr:39:13 in 'from_rs'
from lib/avram/src/avram/save_operation.cr:367:17 in 'insert'
from lib/avram/src/avram/save_operation.cr:349:7 in 'insert_or_update'
from lib/avram/src/avram/save_operation.cr:297:9 in 'save'
from lib/avram/src/avram/save_operation.cr:321:8 in 'save!'
from lib/breeze/src/breeze/operations/save_breeze_sql_statement.cr:1:1 in 'create!:breeze_request_id:statement:args:model:elapsed_text'
from lib/breeze/src/breeze.cr:14:3 in '->'
from /usr/local/Cellar/crystal/0.36.1_2/src/primitives.cr:255:3 in 'run'
from /usr/local/Cellar/crystal/0.36.1_2/src/fiber.cr:92:34 in '->'
```

I have it set to only enable while in development, so in theory breeze should be skipped during tests... I'll try to dig in more to see what specifically is causing this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack-trace entries in lib/pg/src/pq/connection.cr, lib/avram/src/avram/save_operation.cr, and lib/breeze/src/breeze.cr, then reproduce the deadlock while running the app's specs. Determine why Breeze runs during tests despite being development-only; done means the specs no longer produce these deadlock errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal, postgresql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.