Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read timeout to overpass-api after 120000 ms #889

Open
Binnette opened this issue Apr 15, 2021 · 4 comments
Open

Read timeout to overpass-api after 120000 ms #889

Binnette opened this issue Apr 15, 2021 · 4 comments

Comments

@Binnette
Copy link

Hello,

I love to create challenges with Overpass API, but recently I 'saw' that the default timeout was lowered from 180s to 120s 😭

So I read the source code and I saw that if my overpass query start with [out:json] or [timeout:_TIME_] then Maproulette should take in account my 'custom timeout'. But sadly something is not working properly and my custom timeout is not used.

Here is a way to reproduce the issue:

  1. Create a challenge with the following overpass query:
[timeout:180];
node[amenity=drinking_water];
out;
// DO NOT USE THIS QUERY FOR REGULAR CHALLENGE
// Because It queries all the drinking water node worldwide!!!

or the same query but starting with [out:json][timeout:180]

  1. Run the challenge
  2. Wait 120s to get the following error message Read timeout to overpass-api.de/xxx.xxx.xxx.xxx:80 after 120000 ms
  3. BUG! The query should have stoped at the correct 180s timeout and not an arbitrary 120s.

Part of the code to handle this timeout is in this file: ChallengeProvider.scala

Thanks all contributors for the good work done on Maproulette ❤️

@hfs
Copy link

hfs commented Jan 6, 2022

Sounds like the same issue as #842 again?

@Penegal
Copy link

Penegal commented Jun 5, 2022

Hello, there! I got the same problem, with Overpass API request failing after 120s, when I set the request with a 1200s timeout.

For the record, the request:

[timeout:1200];
area[name="France"]->.searchArea;
(
  wr[landuse=forest][name~"omaniale"](area.searchArea);
  wr[landuse=forest][name~"ommunale"](area.searchArea);
  wr[landuse=forest][operator~"ONF"](area.searchArea);
  wr[landuse=forest][operator~"ffice"](area.searchArea);
);
out geom;

@rurseekatze
Copy link

Any news on this issue? I have the same problem, also tried the [timeout:1200]; statement with different values without success.

@ljdelight
Copy link
Contributor

ljdelight commented Sep 17, 2023

The request is timing out because it hits the global socket idle timeout (play.ws.timeout.idle) of 2 minutes and unfortunately WSClient does not provide a way to change the idle timeout for a specific request. So while the code does parse the (request) timeout from the overpass query and sets it on the WSClient via withRequestTimeout, the idle timeout is unchanged and the request will terminate at 2 minutes if there is no tcp activity.

Changing the global idle timeout is an option, however, setting it too high could risk system resources being tied up in idle connections. An alternative solution, in the maproulette backend source, could be to create/inject a different instance of a WSClient with a longer idle timeout and use that instance (not the globally play-injected client) for the overpass requests.

A workaround is to execute the query through the Overpass UI and then use the generated GeoJSON data to create the challenge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

5 participants