2.6.8 on windows fails on pluginJars dirs #1898

Closed
niphlod opened this Issue Jun 15, 2016 · 4 comments

Projects

None yet

2 participants

@niphlod
niphlod commented Jun 15, 2016

Updated from 2.6.7 to 2.6.8, 2.6.8 launched on Windows fails with multiple repetitions of this error

java.nio.file.FileSystemException: C:\RUNDECK\var\tmp\pluginJars\20160615155414974-rundeck-stub-plugin-2.6.8.jar

launching 2.6.7 works perfectly

@niphlod
niphlod commented Jun 15, 2016

this is probably the commit to blame 2dd38d6

@gschueler
Contributor

hi, do you have a stacktrace for the error?

@niphlod
niphlod commented Jun 15, 2016

yep. this is for a single .jar but basically for every plugin there's a similar stacktrace
issues_1898.txt

@gschueler
Contributor

our jar plugin code seems to copy the source plugin to a "cache" file using timestamp. I think we need to fix that, either to use AtomicLong counter instead of timestamp, or remove/improve the caching code.

It seems like two threads are writing to the same cache file. On unix, the destination file seems to get overwritten without error (although there are some other possibly related issues **), but on Windows this causes an error

@gschueler gschueler added the bug label Jul 15, 2016
@gschueler gschueler added this to the 2.6.9 milestone Jul 15, 2016
@gschueler gschueler self-assigned this Jul 16, 2016
@gschueler gschueler added a commit that closed this issue Jul 18, 2016
@gschueler gschueler fix #1898 avoid file writing contention
fix jar plugin loader to avoid contention
with overwriting the same file if multiple threads
attempt to load classes from the same jar:
* use unique string in cached file name
* only use one cached file/libset per loader
* clean up all cached files
2cd67a4
@gschueler gschueler closed this in 2cd67a4 Jul 18, 2016
@gschueler gschueler removed the in progress label Jul 18, 2016
@variacode95 variacode95 pushed a commit to variacode95/rundeck that referenced this issue Jul 20, 2016
@gschueler @parth-kloudscript gschueler + parth-kloudscript fix #1898 avoid file writing contention
fix jar plugin loader to avoid contention
with overwriting the same file if multiple threads
attempt to load classes from the same jar:
* use unique string in cached file name
* only use one cached file/libset per loader
* clean up all cached files
f186a4e
@gschueler gschueler referenced this issue in rundeck-plugins/rundeck-winrm-plugin Aug 1, 2016
Open

Randomly getting NoClassDefFoundError #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment