-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support symlink webapp deployment #1200
Comments
How does that work? |
In Jetty 9.3.x a symlink of Seems to be because ...
|
Ooops I meant |
A testcase like this ....
In Jetty 9.3.x, the venerable The I would consider a fix to @gregw how do you want to proceed with this? |
Updated (and Ignored) the That test does not pass current (hence the Ignored state) |
I think there are two things to consider: updating to use the PathWatcher, and then making it an option to provide either the non canonical path; or both the canonical and the non-canonical path. |
Option #3 - no code change, we could document this scenario and say to use a Jetty XML deployable instead. |
I think option 3 is what we go with until there is a reason to touch this code (ie to retire Scanner) - hence it is a low priority enhancement. |
This used to work in Jetty 6, admittedly that was a long time ago. |
Jetty 6 is EOL and had a few filesystem vulnerabilities when working with various FileSystem quirks (symlinks, hardlinks, alternate data channel access, networked filesystem mounts, etc.) We really do not want to go back the wild west of unintended behaviors that existed in Jetty 6. |
I think we still leave this open. Using a symlink to indicate what the context path should be is a reasonable approach- it's just that our implementation within the Scanner make it hard to do safely or at least easily. I'll try to have a look in the next few days to really see if there is not an easy/safe way of seeing the link name and using it as the basis of the default context path calculations. |
I had a look at the Scanner and it is indeed too difficult to bring back that behaviour. So I've added this a 10 milestone. If we implement it and it proves to be fully backwards compatible, we may cherry pick back to a 9 release. |
Updated PathWatcher to use IncludeExcludeSet
I've updated the subject to better indicate what this issue has become. Firstly the PathWatcherTest is ignored! I can see why some edge cases might be hard to test cross platform, but we need to have the basic core behaviour tested. I can see one test bug that probably has caused grief with the unit tests: the countdownLatch is decremented and then the results map is updated, so there is a race with waiting for the latch and checking the results. With this swapped, I'm getting all the tests to pass on my machine, plus a new test that I have added. The new test I have added is just a sequence of pretty normal events, as I wanted to understand the behaviour as it exists. This has revealed a few behaviours that I don't think are completely correct: 3eadc5f#diff-b6fb799345688b3d57231a9689dedc6cR362 3eadc5f#diff-b6fb799345688b3d57231a9689dedc6cR419 3eadc5f#diff-b6fb799345688b3d57231a9689dedc6cR433 For DeploymentManager, fixing the slow add is important, but I'd like to look at fixing the other issues as well. What are your thoughts on them and what other usages of PathWatcher am I likely to break if I start messing with the behaviour too much? @janbartel as the author if |
This reverts commit 3eadc5f. Will fix issues in 9.4 and merge forward
@joakime can you test branch jetty-9.4.x-1200 on windows to see if the unit tests are passing? |
@gregw sent you the build/test results. 10 failures in OSX 10.11.6 (Java 8u144), 5 failures in Windows 10 (Java 8u144). |
+ We should really be testing the FileSystem (not the OS) to make the timing constants be more sane. (APFS for example should be much lower on newer OSX installations
Results: Windows 10 (Java 8u144) jetty-util : no failures on this branch. OSX 10.11.6 (Java 8u144) jetty-util: failed test cases. [INFO] Running org.eclipse.jetty.util.PathWatcherTest
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testStartupFindFiles()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testDeployFiles_Update_Delete()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testDeployFiles_ModifyWar_LargeSlowCopy()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testDeployFilesBeyondDepthLimit()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testDeployFiles_NewDir()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testDeployFiles_NewWar()
{foo.war=[ADDED], bar/WEB-INF/web.xml=[ADDED], hello.war=[ADDED, MODIFIED]}
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testGlobPattern()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testWatchFile()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testRestart()
[AdvancedRunner] Running org.eclipse.jetty.util.PathWatcherTest.testSequence()
[ERROR] Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 340.266 s <<< FAILURE! - in org.eclipse.jetty.util.PathWatcherTest
[ERROR] testDeployFiles_NewWar(org.eclipse.jetty.util.PathWatcherTest) Time elapsed: 28.019 s <<< FAILURE!
java.lang.AssertionError:
Events for path [hello.war]
Expected: iterable containing [<ADDED>]
but: Not matched: <MODIFIED>
at org.eclipse.jetty.util.PathWatcherTest.testDeployFiles_NewWar(PathWatcherTest.java:744) |
@joakime can you run the OSX test again but with logging including:
|
Squashed commit of the following: commit 08b5acc Merge: cea3366 daeb844 Author: Greg Wilkins <[email protected]> Date: Tue Sep 5 12:43:01 2017 +1000 Merge branch 'jetty-9.4.x' into jetty-9.4.x-1200 commit cea3366 Author: Greg Wilkins <[email protected]> Date: Tue Sep 5 12:42:21 2017 +1000 Issue #1200 ignore OSX failure commit fd2493f Author: Greg Wilkins <[email protected]> Date: Tue Sep 5 12:11:05 2017 +1000 Issue #1789 PropertyUserStoreTest failures on windows commit 89aa59c Author: Greg Wilkins <[email protected]> Date: Tue Sep 5 11:56:52 2017 +1000 Issue #1200 fixes for windows commit 1904b45 Merge: 74d770e eec6453 Author: Greg Wilkins <[email protected]> Date: Tue Sep 5 11:45:19 2017 +1000 Merge branch 'jetty-9.4.x' into jetty-9.4.x-1200 commit 74d770e Author: Greg Wilkins <[email protected]> Date: Fri Sep 1 10:47:05 2017 +1000 Issue #1200 fixes for windows commit f4ee0e9 Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 10:24:07 2017 +1000 Issue #1200 improved tests for long duration quiet time commit 17381cb Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 10:03:04 2017 +1000 Issue #1200 fixed javadoc commit b3a12c1 Merge: ed0db46 ce4adb5 Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 09:41:50 2017 +1000 Merge branch 'jetty-9.4.x-1200' of github.com:eclipse/jetty.project into jetty-9.4.x-1200 commit ed0db46 Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 09:39:46 2017 +1000 Issue #1200 Improved PathWatcher commit ce4adb5 Merge: f993a7c 48aaecb Author: Joakim Erdfelt <[email protected]> Date: Wed Aug 30 16:38:07 2017 -0700 Merge branch 'jetty-9.4.x-1200' of github.com:eclipse/jetty.project into jetty-9.4.x-1200 commit f993a7c Author: Joakim Erdfelt <[email protected]> Date: Wed Aug 30 16:37:45 2017 -0700 Issue #1200 - adding some important OSX/HFS+ timing differences + We should really be testing the FileSystem (not the OS) to make the timing constants be more sane. (APFS for example should be much lower on newer OSX installations commit 48aaecb Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 08:50:42 2017 +1000 Issue #1200 Improved PathWatcher diff commit 1917f8b Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 08:36:40 2017 +1000 Issue #1200 Improved PathWatcher diff commit ecf0023 Author: Greg Wilkins <[email protected]> Date: Thu Aug 31 08:22:41 2017 +1000 Issue #1200 Test improved PathWatcher commit 0d76544 Merge: 0fd7187 eb1320f Author: Greg Wilkins <[email protected]> Date: Wed Aug 30 16:43:15 2017 +1000 Merge branch 'jetty-9.4.x' into jetty-9.4.x-1200 commit 0fd7187 Author: Greg Wilkins <[email protected]> Date: Wed Aug 30 15:58:24 2017 +1000 Issue #1200 Improve PathWatcher
Note that I have merged to jetty-9.4.x branch with the OSX failure ignored as I think this is already better than the untested. We can improve in the main branch |
Working with Jesses to get OSX slave added to Jenkins (and update/reconfigure Windows slave) to help test this. |
The PathWatcher has never delivered on it's promise of efficient path scanning, primarily because of too many OS differences. PR #4239 has improved the Path semantics of the Scanner, so we no longer need to switch to the PathWatcher. |
Creating a symlink like
webapps/root->/some/path/myapp.war
results in a context being deployed at/myapp
rather than at/
The text was updated successfully, but these errors were encountered: