M4rtinK / modrana

ModRana is a flexible GPS navigation system for mobile devices. This is the main upstream modRana source code repository - waiting for your pull requests & patches! :)
www.modrana.org
GNU General Public License v3.0
66 stars 21 forks source link

drop timeout for tile download, addresses #201 #202

Closed rinigus closed 7 years ago

rinigus commented 7 years ago

Morning! Ping regarding this pull request - would be great to get your opinion on it. As it is, modRana - OSM Scout Server interaction could be disturbed due to the timeouts.

M4rtinK commented 7 years ago

I was rather busy so sorry for not replying to this sooner. :)

I plan to take a look during the weekend.

My main worry is unconditionally removing the timeout globally - I'll have to look at the code in more detail if this really could happen - but I'd like to prevent:

But as I say above - I have to investigate - it might not be that bad and using None might just use some default timeout (30 seconds ?) so these scenarios would not really happen.

rinigus commented 7 years ago

Yes, it does need some investigation. I think that in Poor Maps there is a difference whether connection is to localhost (aka OSM Scout Server) or to the outside servers. For localhost, we maybe could drop timeouts. I don't know how its implemented in modRana, but maybe it does have difference on whether it can establish connection and waits for reply or whether the receiving end is not available (server is closed).

In addition, I don't know whether 30 seconds is sufficient. There maybe rather complex cases for the rendering and slow phones.

M4rtinK commented 7 years ago

So looking at the code in more detail (I really should simplify this eventually, it much too convoluted) - it looks like it should be easy to set a per layer timeout, because there are separate per-layer connection pools to facilitate connection reuse.

So it should be possible to set a longer timeout for the pools for the OSM Scout Server layers separately from the other pools, solving the issue.

I'll try to implement this later today. :)

rinigus commented 7 years ago

Sounds great!

M4rtinK commented 7 years ago

Looks like this PR should fix the issue: https://github.com/M4rtinK/modrana/pull/204 Testing & feedback welcome! :)

rinigus commented 7 years ago

Closing PR since a better implementation is available