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

Race condition on map validation leads to invalid map creation #544

Open
rochoa opened this issue Mar 30, 2017 · 0 comments
Open

Race condition on map validation leads to invalid map creation #544

rochoa opened this issue Mar 30, 2017 · 0 comments

Comments

@rochoa
Copy link
Contributor

rochoa commented Mar 30, 2017

It's possible to create a valid Layergroup id with an invalid MapConfig.

Give a MapConfig like:

{"layers":[{"options":{"sql":"SELECT null::geometry the_geom_webmercator"}}]}

The map backend will try store the configuration in Redis. If the configuration was not already in Redis, it will validate the MapConfig creating some renderers. However, if another request arrives before the validation has ended, it will found the Layergroup id in Redis and it will return it without any kind of validation.

I was able to reproduce the issue using GNU Parallel using:

parallel curl ::: -s -s ::: http://development.localhost.lan:8181/api/v1/map?config=%7B%22layers%22%3A%5B%7B%22options%22%3A%7B%22sql%22%3A%22SELECT+null%3A%3Ageometry+the_geom_webmercator%22%7D%7D%5D%7D http://development.localhost.lan:8181/api/v1/map?config=%7B%22layers%22%3A%5B%7B%22options%22%3A%7B%22sql%22%3A%22SELECT+null%3A%3Ageometry+the_geom_webmercator%22%7D%7D%5D%7D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant