Hi,
We have some tables stored in Postgresql and published as layers in Geoserver. When I connect to these tables by WFS in QGIS, I get some timeouts. Probably because the tables are big and I haven’t set the page size correct. What I experience is that QGIS will try to reconnect, up to 3 times it tries this.
When I looked into the PostgreSQL server and the list of open sessions for this database, I noticed that there were queries for all these tries. None of them seemed to care that the user was gone. That doesn’t seem to be a viable solution.
For WMS there is a setting “Max rendering time”. Is there something similar for WFS “Max querying time”? I haven’t found it in the documentation.
Or would it be possible to have a parallel thread that repeatedly check that the client is still connected?
I believe the request to the database is “blocking”, so it may not notice the client is gone until the response comes back from the database and java starts processing rows into output a feature at a time…
Discussion:
It is likely that we read the features in one thread, and output them in another. I wonder if we kill the reading thread if the JDBC driver will notice and hang up on the server?
To me it seems like reading and encoding is done in the same thread, but there is an additional thread to query for the count of features. The query is opened when we’re starting to encode the response. And the root point seems to be the WFSGetFeatureOutputFormat.write function.
There we have the output, so it could be possible to have some code that checks if it’s closed before the query has ended.