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

java.nio.channels.ClosedChannelException #286

Open
boswellp opened this issue Nov 26, 2020 · 7 comments · Fixed by #393
Open

java.nio.channels.ClosedChannelException #286

boswellp opened this issue Nov 26, 2020 · 7 comments · Fixed by #393
Assignees
Labels
bug Something isn't working as expected question Further information is requested

Comments

@boswellp
Copy link

On Ubuntu 18.04, running ETL with the usual command line:

mvn exec:java -Dexec.mainClass="org.heigit.bigspatialdata.oshdb.tool.importer.extract.Extract" -Dexec.args="--pbf /home/ertert/oshdb-new/oshdb-tool/etl/files/switzerland-internal.osh.pbf -tmpDir ./tmpFiles -workDir ./results --timevalidity_from 2017-01-01" -Dexec.cleanupDaemonThreads=false

when execution starts I get:

joining on thread Thread[org.heigit.bigspatialdata.oshdb.tool.importer.extract.Extract.main(),5,org.heigit.bigspatialdata.oshdb.tool.importer.extract.Extract]
extracting key tables ...[WARNING]
java.lang.RuntimeException: java.nio.channels.ClosedChannelException

which becomes :

BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.887 s
[INFO] Finished at: 2020-11-26T08:24:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project etl: An exception occured while executing the Java class. java.nio.channels.ClosedChannelException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project etl: An exception occured while executing the Java class. java.nio.channels.ClosedChannelException

java.nio.channels.ClosedChannelException is a fairly common issue and generally related to programming. Any thoughts?

@boswellp boswellp added the bug Something isn't working as expected label Nov 26, 2020
@boswellp
Copy link
Author

I should perhaps add that I reinstalled OSHDB 0.5.9 and it works fine for all three ETL stages. The ClosedChannelException issue is with version 0.5.10.

@rtroilo
Copy link
Member

rtroilo commented Nov 26, 2020

Hi Peter,

thank you for reporting this bug.
One question, could you reproduce this bug with the same dataset and oshdb version. Because there should not be a major change between 0.5.9 and 0.5.10 for the ETL stages.

But we should definitely catch this exception.

@boswellp
Copy link
Author

boswellp commented Nov 26, 2020 via email

@tyrasd tyrasd added the question Further information is requested label Dec 2, 2020
@boswellp
Copy link
Author

boswellp commented Jun 1, 2021

Hello,

I was wondering if there is any solution for this issue.

For both Oracle java and OpenJDK I have exactly the same issue for OSHDB 0.6.1 to 0.6.4. etl 0.5.11 works fine in all cases. I've tried several osh files, all of which work with 0.5.11 and by all accounts are history files (checked using osmium fileinfo).

@rtroilo
Copy link
Member

rtroilo commented Jun 2, 2021

Hi Peter,

thank you for your report. The closed channel exception at the end should no corrupt your generated oshdb. Could you confirm that your generated oshdb does not work?
And sorry for this annoying error message, we will remove this.

@boswellp
Copy link
Author

boswellp commented Jun 2, 2021 via email

rtroilo added a commit that referenced this issue Jul 5, 2021
rtroilo added a commit that referenced this issue Jul 5, 2021
reverts some resource-leak refactorings 5e8ba71 which closes the resources to eagerly
rtroilo added a commit that referenced this issue Jul 5, 2021
* fixes #286 closed_channel_exception
reverts some resource-leak refactorings 5e8ba71 which closes the resources to eagerly

Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
@Hagellach37 Hagellach37 added this to the release 1.0 milestone Oct 20, 2022
@Hagellach37
Copy link

This will be fixed by @rtroilo when re-integrating the new importer.

@tyrasd tyrasd removed this from the release 1.0.0 milestone Mar 9, 2023
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 question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants