Skip to content

Replace Janus queue with asyncio.Future#2715

Merged
simonw merged 3 commits into
mainfrom
remove-janus
May 16, 2026
Merged

Replace Janus queue with asyncio.Future#2715
simonw merged 3 commits into
mainfrom
remove-janus

Conversation

@simonw
Copy link
Copy Markdown
Owner

@simonw simonw commented May 16, 2026

@simonw simonw changed the title Replace Janus queeu with asyncio.Future Replace Janus queue with asyncio.Future May 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (46d90a0) to head (2e1fed0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datasette/database.py 0.00% 50 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2715   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         57      57           
  Lines       8763    8776   +13     
=====================================
- Misses      8763    8776   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread datasette/database.py
reply_queue = janus.Queue()
loop = asyncio.get_running_loop()
reply_future = loop.create_future()
self._write_queue.put(
Copy link
Copy Markdown
Owner Author

@simonw simonw May 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that even though we dropped the Janus queue we still queue writes using a standard library Queue, which is created here:

async def _send_to_write_thread(
self, fn, block=True, isolated_connection=False, transaction=True
):
if self._write_queue is None:
self._write_queue = queue.Queue()

@simonw
Copy link
Copy Markdown
Owner Author

simonw commented May 16, 2026

From the coverage report it looks like our tests don't exercise the various cases where an exception is raised during a query.

@simonw simonw merged commit 3110faa into main May 16, 2026
36 of 37 checks passed
@simonw simonw deleted the remove-janus branch May 16, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant