You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason obspy.clients.filesystem.tsindex client crashes with a SQLAlchemy QueuePool limit overflow when searching for waveforms: ValueError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00 (Background on this error at: https://sqlalche.me/e/14/3o7r).
I have no idea what the underlying issue is. My suspect is that either wildcard queries spawn too many queues(?) and/or that they are not released in case the search fails...? FWIW, I did try several different versions of SQLAlchemy (currently: 1.4.52, tested also 2.0.29) and mseedindex (currently: 3.0.5, tested 2.7.1). All are installed with pip install ==version.
Something that might be related is that before I added the data_client.has_data() clause the code bit spawned a ton of SAWarning: SELECT statement has a cartesian product between FROM element(s) "flattened_request_cte", "tsindex" and FROM element "raw_request_cte". Apply join condition(s) between each element to resolve. warnings too. Afterwards, it still throws this every now and then but adding the has_data check cut them down to something like few percent.
As background for the code, the way I create the index is: indexer = Indexer( mseed_archive_location, mseed_archive_SQL_index, leap_seconds_file = 'DOWNLOAD', parallel = 1 ); indexer.run()
Finally, the "solution"...
The way I circumvented the issue was adding pool_size and max_overflow to line 1379 of ./obspy/clients/filesystem/tsindex.py: self.engine = sa.create_engine(db_path, poolclass=QueuePool, pool_size = 100, max_overflow = 1000 )
However, I have no idea whether this only postpones the issue or sorts it out completely.
Code to Reproduce
# Basically this codeblock. Client can be tsindex or FDSN client, but only the tsindex crashes.try:
hasdata=data_client.has_data( network="*", station=station, location="*", channel="*", starttime=trace_start, endtime=trace_start+trace_length )
exceptAttributeError:
hasdata=True# We have a FDSN client insteadif ( hasdata ):
try:
st=data_client.get_waveforms( network="*", station=station, location="*", channel="*", starttime=trace_start, endtime=trace_start+trace_length )
except ( FDSNForbiddenException, FDSNNoDataException ) asE:
st=False
Avoid duplicates
Bug Summary
For some reason
obspy.clients.filesystem.tsindex
client crashes with a SQLAlchemy QueuePool limit overflow when searching for waveforms:ValueError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00 (Background on this error at: https://sqlalche.me/e/14/3o7r)
.I have no idea what the underlying issue is. My suspect is that either wildcard queries spawn too many queues(?) and/or that they are not released in case the search fails...? FWIW, I did try several different versions of SQLAlchemy (currently: 1.4.52, tested also 2.0.29) and mseedindex (currently: 3.0.5, tested 2.7.1). All are installed with pip install ==version.
Something that might be related is that before I added the
data_client.has_data()
clause the code bit spawned a ton ofSAWarning: SELECT statement has a cartesian product between FROM element(s) "flattened_request_cte", "tsindex" and FROM element "raw_request_cte". Apply join condition(s) between each element to resolve.
warnings too. Afterwards, it still throws this every now and then but adding the has_data check cut them down to something like few percent.As background for the code, the way I create the index is:
indexer = Indexer( mseed_archive_location, mseed_archive_SQL_index, leap_seconds_file = 'DOWNLOAD', parallel = 1 ); indexer.run()
Finally, the "solution"...
The way I circumvented the issue was adding pool_size and max_overflow to line 1379 of
./obspy/clients/filesystem/tsindex.py
:self.engine = sa.create_engine(db_path, poolclass=QueuePool, pool_size = 100, max_overflow = 1000 )
However, I have no idea whether this only postpones the issue or sorts it out completely.
Code to Reproduce
Error Traceback
ObsPy Version?
1.4.0
Operating System?
Mint 21.0
Python Version?
3.10.6
Installation Method?
pip
The text was updated successfully, but these errors were encountered: