home / github

Menu
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 638241779

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

id ▼ html_url issue_url node_id user created_at updated_at author_association body reactions issue performed_via_github_app
643685207 https://github.com/simonw/datasette/issues/846#issuecomment-643685207 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY4NTIwNw== simonw 9599 2020-06-13T22:18:01Z 2020-06-13T22:18:01Z OWNER This shows currently open files (after `pip install psutil`): ``` import psutil psutil.Process().open_files() ``` I ran it inside `pytest -x --pdb` and got this: ``` > /Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.7/site-packages/jinja2/utils.py(154)open_if_exists() -> return open(filename, mode) (Pdb) import psutil (Pdb) psutil.Process().open_files() popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp9uhx5d8x/fixtures.db', fd=10), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmpyfw44ica/fixtures.dot.db', fd=11), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmpyrg6g48b/fixtures.db', fd=12), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=13), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=14), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=15), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=16), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=17), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=18), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp33kkg62s/fixtures.db', fd=19), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmpng4lg84_/fixtures.db', fd=20), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp9uhx5d8x/fixtures.db', fd=21), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp9uhx5d8x/fixtures.db', fd=22), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmp9uhx5d8x/fixtures.db', fd=23), popenfile(path='/private/var/folders/wr/hn3206rs1yzgq3r49bz8nvnh0000gn/T/tmph11oalw_/fixtures.db', fd=24), popenfile(path='/private/var/folde… {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  
643685333 https://github.com/simonw/datasette/issues/846#issuecomment-643685333 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY4NTMzMw== simonw 9599 2020-06-13T22:19:38Z 2020-06-13T22:19:38Z OWNER That's 91 open files but only 29 unique filenames. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  
643685669 https://github.com/simonw/datasette/issues/846#issuecomment-643685669 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY4NTY2OQ== simonw 9599 2020-06-13T22:24:22Z 2020-06-13T22:24:22Z OWNER I tried this experiment: ```python import sqlite3, psutil def show_things(): conn = sqlite3.connect("fixtures.db") tables = [r[0] for r in conn.execute("select * from sqlite_master").fetchall()] return tables print(psutil.Process().open_files()) print(show_things()) print(psutil.Process().open_files()) ``` To see if the connection would be automatically released when the `conn` variable was garbage collected at the end of the function... and it was correctly released - the two calls to `open_files()` showed that the file did not remain open. Likewise: ``` In [11]: conn = sqlite3.connect("fixtures.db") In [12]: psutil.Process().open_files() Out[12]: [popenfile(path='/Users/simon/.ipython/profile_default/history.sqlite', fd=4), popenfile(path='/Users/simon/.ipython/profile_default/history.sqlite', fd=5), popenfile(path='/Users/simon/Dropbox/Development/datasette/fixtures.db', fd=12)] In [13]: del conn In [14]: psutil.Process().open_files() Out[14]: [popenfile(path='/Users/simon/.ipython/profile_default/history.sqlite', fd=4), popenfile(path='/Users/simon/.ipython/profile_default/history.sqlite', fd=5)] ``` So presumably there's something about the way my pytest fixtures work that's causing the many different `Datasette()` instances and their underlying SQLite connections that I… {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  
643698790 https://github.com/simonw/datasette/issues/846#issuecomment-643698790 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY5ODc5MA== simonw 9599 2020-06-14T00:20:42Z 2020-06-14T00:20:42Z OWNER Released a new plugin, `datasette-psutil`, as a side-effect of this investigation: https://github.com/simonw/datasette-psutil {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  
643699063 https://github.com/simonw/datasette/issues/846#issuecomment-643699063 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY5OTA2Mw== simonw 9599 2020-06-14T00:22:32Z 2020-06-14T00:22:32Z OWNER Idea: `num_sql_threads` (described as "Number of threads in the thread pool for executing SQLite queries") defaults to 3 - can I knock that down to 1 in the tests and open less connections as a result? {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  
643699583 https://github.com/simonw/datasette/issues/846#issuecomment-643699583 https://api.github.com/repos/simonw/datasette/issues/846 MDEyOklzc3VlQ29tbWVudDY0MzY5OTU4Mw== simonw 9599 2020-06-14T00:26:31Z 2020-06-14T00:26:31Z OWNER That seems to have fixed the problem, at least for the moment. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} "Too many open files" error running tests 638241779  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 23.742ms · About: simonw/datasette-graphql