-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Note, this was also reported on zulip. I think it is connected to the extras table. We also get an error from insert_many during the stats stage.
db.nf_fields.stats.refresh_stats() gives an error after many lines of the timing of different stats:
2025-12-31 18:38:01,713 - SELECT COUNT() FROM "nf_fields" WHERE "degree" = 3 AND "num_ram" = 3 AND "ramps" @> ARRAY[ARRAY[2]]::numeric[] ran in 2.1417524814605713s
2025-12-31 18:38:03,482 - SELECT COUNT() FROM "nf_fields" WHERE "degree" = 3 AND "num_ram" = 2 AND "ramps" @> ARRAY[ARRAY[2]]::numeric[] ran in 1.760584831237793s
2025-12-31 18:38:04,242 - SELECT COUNT() FROM "nf_fields" WHERE "class_number" >= 10 AND "degree" = 2 AND "r2" = 0 ran in 0.7044963836669922s
2025-12-31 18:38:04,421 - SELECT COUNT() FROM "nf_fields" WHERE "class_number" = 3 AND "degree" = 2 AND "r2" = 0 ran in 0.1697683334350586s
2025-12-31 18:38:09,682 - SELECT COUNT(*) FROM "nf_fields" WHERE "inessentialp" @> ARRAY[ARRAY[5]]::integer[] ran in 5.171377182006836s
INFO:LMFDB@2025-12-31 18:38:10,478: Connection broken (status 2); resetting...
INFO:LMFDB@2025-12-31 18:38:10,479: Connecting to PostgresSQL server as: user=editor host=grace.mit.edu port=5432 dbname=lmfdb...
INFO:LMFDB@2025-12-31 18:38:10,493: Done!
connection = <connection object at 0x7f257a546980; dsn: 'user=editor password=xxx dbname=lmfdb host=grace.mit.edu port=5432', closed: 0>
OperationalError Traceback (most recent call last)
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/base.py:312, in PostgresBase._execute(self, query, values, silent, values_list, template, commit, slow_note, reissued, buffered)
311 try:
--> 312 cur.execute(query, values)
313 except (OperationalError, ProgrammingError, NotSupportedError, DataError, SyntaxError) as e:
OperationalError: SSL connection has been closed unexpectedly
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last)
Cell In[2], line 1
----> 1 db.nf_fields.stats.refresh_stats()
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/statstable.py:1583, in PostgresStatsTable.refresh_stats(self, total, reset_None_to_1, suffix)
1581 continue
1582 self.add_numstats(col, grouping, (ccols, cvals), threshold, suffix=suffix)
-> 1583 self._add_extra_counts(col_value_dict, suffix=suffix)
1585 if total:
1586 # Refresh total in meta_tables
1587 self.total = self._slow_count({}, suffix=suffix, extra=False)
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/statstable.py:1669, in PostgresStatsTable._add_extra_counts(self, col_value_dict, suffix)
1667 query = self._join_dict(cols, values)
1668 if self.quick_count(query, suffix=suffix) is None:
-> 1669 self._slow_count(query, record=True, suffix=suffix)
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/statstable.py:329, in PostgresStatsTable._slow_count(self, query, split_list, record, suffix, extra)
327 if qstr is not None:
328 selecter = SQL("{0} WHERE {1}").format(selecter, qstr)
--> 329 cur = self._execute(selecter, values)
330 nres = cur.fetchone()[0]
331 if record and self.saving:
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/base.py:318, in PostgresBase._execute(self, query, values, silent, values_list, template, commit, slow_note, reissued, buffered)
316 except Exception:
317 context = " happens while executing {} with values {}".format(query, values)
--> 318 reraise(type(e), type(e)(str(e) + context), sys.exc_info()[2])
319 if silent is False or (silent is None and not self._db._silenced):
320 t = time.time() - t
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/utils.py:239, in reraise(exc_type, exc_value, exc_traceback)
237 exc_value = exc_type()
238 if exc_value.traceback is not exc_traceback:
--> 239 raise exc_value.with_traceback(exc_traceback)
240 raise exc_value
File /home/sage/sage-10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/psycodict/base.py:312, in PostgresBase._execute(self, query, values, silent, values_list, template, commit, slow_note, reissued, buffered)
310 else:
311 try:
--> 312 cur.execute(query, values)
313 except (OperationalError, ProgrammingError, NotSupportedError, DataError, SyntaxError) as e:
314 try:
OperationalError: SSL connection has been closed unexpectedly
happens while executing b'SELECT COUNT(*) FROM "nf_fields" WHERE "degree" = 3 AND "disc_rad" <= 182 AND "num_ram" <= 3 AND "ramps" <@ ARRAY[2,7,13]::numeric[]'