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 when redacted deleted way is referenced by relations #325

Closed
tyrasd opened this issue Dec 22, 2020 · 0 comments · Fixed by #326
Closed

race condition when redacted deleted way is referenced by relations #325

tyrasd opened this issue Dec 22, 2020 · 0 comments · Fixed by #326
Assignees
Labels
bug Something isn't working as expected

Comments

@tyrasd
Copy link
Member

tyrasd commented Dec 22, 2020

Describe the bug
When a relation (like relation/10215810) references a way which has only one "deleted" version after redactions (like way/687863323), the CellIterator hits a race condition here.

To Reproduce

    OSMEntitySnapshotView
          .on(oshdb).keytables(keytables)
          .areaOfInterest(new OSHDBBoundingBox(44.0,46.0,44.5,46.5))
          .timestamps("2020-12-01")
          .osmType(OSMType.RELATION)
          .osmEntityFilter(e -> e.getId() == 10215810L)
          .count();

alternatively triggered via ohsome API:

curl -X GET "https://api.ohsome.org/v1/elements/count?bboxes=44.0%2C46.0%2C44.5%2C46.5&filter=type%3Arelation%20and%20id%3A10215810&format=json&time=2014-01-01%2F2020-01-01%2FP1Y"

Expected behavior
no error should be triggered

Error messages, logs, screenshots

java.util.NoSuchElementException
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1000)
	at org.heigit.bigspatialdata.oshdb.osh.OSHEntities._getModificationTimestamps(OSHEntities.java:459)
	at org.heigit.bigspatialdata.oshdb.osh.OSHEntities.getModificationTimestamps(OSHEntities.java:312)
	at org.heigit.bigspatialdata.oshdb.osh.OSHEntities.getModificationTimestamps(OSHEntities.java:246)
	at org.heigit.bigspatialdata.oshdb.util.celliterator.CellIterator.lambda$iterateByContribution$7(CellIterator.java:485)

System (please complete the following information):

  • OSHDB Version: 0.7.0-SNAPSHOT, 0.6.0, 0.5.10

Additional context
We should probably provide a backport for this bug fix for 0.6 and 0.5.

@tyrasd tyrasd added the bug Something isn't working as expected label Dec 22, 2020
@tyrasd tyrasd self-assigned this Dec 22, 2020
tyrasd added a commit that referenced this issue Dec 22, 2020
tyrasd added a commit that referenced this issue Dec 22, 2020
joker234 pushed a commit that referenced this issue Dec 23, 2020
joker234 pushed a commit that referenced this issue Dec 23, 2020
tyrasd added a commit that referenced this issue Dec 23, 2020
* fix crash when relation references redacted way

fixes #325

* add test for #325

* add to changelog

* add inline comment, more consistent usage of Longs
tyrasd added a commit that referenced this issue Dec 23, 2020
* 0.6.1 with bugfixes for #325 and #321
* 0.5.11 with bugfix for #325
tyrasd added a commit that referenced this issue Dec 23, 2020
* 0.6.1 with bugfixes for #325 and #321
* 0.5.11 with bugfix for #325
tyrasd added a commit that referenced this issue Dec 23, 2020
* 0.6.1 with bugfixes for #325 and #321
* 0.5.11 with bugfix for #325
tyrasd added a commit that referenced this issue Dec 23, 2020
cherry-pick fix for #325
tyrasd added a commit that referenced this issue Dec 23, 2020
* cherry-pick fix for #325
* cherry-pick fix for #321
* fix links to published javadoc
tyrasd added a commit that referenced this issue Dec 23, 2020
* cherry-pick fix for #325
* cherry-pick fix for #321
* fix links to published javadoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant