{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/jetty.project/pulls/comments/140917309","pull_request_review_id":65053176,"id":140917309,"diff_hunk":"@@ -323,4 +328,23 @@ public void testResources() throws Exception\n         \n     }\n \n+    @Test\n+    public void ordering() throws Exception\n+    {\n+        Enumeration<URL> resources = _loader.getResources(\"org/acme/clashing.txt\");","path":"jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppClassLoaderTest.java","position":33,"original_position":33,"commit_id":"8aa954a3c7e0a26bdab0b56e8beed3268b225250","original_commit_id":"8aa954a3c7e0a26bdab0b56e8beed3268b225250","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"Yes, it seems to work.","created_at":"2017-09-25T22:36:55Z","updated_at":"2017-09-25T22:36:59Z","html_url":"https://github.com/eclipse/jetty.project/pull/1824#discussion_r140917309","pull_request_url":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/comments/140917309"},"html":{"href":"https://github.com/eclipse/jetty.project/pull/1824#discussion_r140917309"},"pull_request":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824"}},"in_reply_to_id":139749201},"pull_request":{"url":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824","id":141367123,"html_url":"https://github.com/eclipse/jetty.project/pull/1824","diff_url":"https://github.com/eclipse/jetty.project/pull/1824.diff","patch_url":"https://github.com/eclipse/jetty.project/pull/1824.patch","issue_url":"https://api.github.com/repos/eclipse/jetty.project/issues/1824","number":1824,"state":"open","locked":false,"title":"Ensure that WebAppClassLoader.addJars considers classpath entries in a deterministic order","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"https://github.com/jenkinsci/jenkins/pull/3026 gives background on a problem recently resolved in Jenkins, which bundles Jetty (currently 9.4.x) as the default embedded container. Briefly, `WEB-INF/lib/*.jar` contained two distinct versions of the same JAR file by accident. If a contained class file was loaded from the newer variant, all was well; if from the older, a runtime error occurred.\r\n\r\nWhat made tracking this bug down particularly tricky was that the discoverer (@MarkEWaite) only saw it happen on two out of six test machines running supposedly identical copies of all software. In particular he had a `Dockerfile` defining the test environment, downloading a specific (checksummed) `jenkins.war`, which was `docker-build`ed on each machine. My working hypothesis is that the order of directory traversal in an unpacked webapp directory inside the resulting container determined which JAR was added to the front of the classpath and was thus loaded. Since the Linux kernel does not make it easy to predict the order of directory entries, and Jetty’s `PathResource` calls `Files.newDirectoryStream` [which says](https://docs.oracle.com/javase/8/docs/api/java/nio/file/DirectoryStream.html)\r\n\r\n> The elements returned by the iterator are in no specific order.\r\n\r\nthe behavior could vary depending on subtle machine factors. Perhaps there is some way to get harder guarantees from Docker, but you should not need to be friends with an AUFS kernel module developer to debug a problem in your webapp.\r\n\r\n“But your webapp should not depend on the order of JARs!” I hear you saying. No, it should not, but it is better to behave deterministically so that `git-bisect` works, developers do not shrug off CI failures with “works on my machine”, etc. I (successfully) made a similar argument in https://github.com/junit-team/junit4/pull/293. Apparently [Tomcat developers turn deaf ears to the pleads of users](https://bz.apache.org/bugzilla/show_bug.cgi?id=57129#c7).\r\n\r\n@reviewbybees for benefit of my colleagues","created_at":"2017-09-15T17:55:31Z","updated_at":"2017-09-25T22:36:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9497496934094cd62851283edae7fde52e0cee06","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824/commits","review_comments_url":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824/comments","review_comment_url":"https://api.github.com/repos/eclipse/jetty.project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/issues/1824/comments","statuses_url":"https://api.github.com/repos/eclipse/jetty.project/statuses/8aa954a3c7e0a26bdab0b56e8beed3268b225250","head":{"label":"jglick:WebAppClassLoader.addJars-ordering","ref":"WebAppClassLoader.addJars-ordering","sha":"8aa954a3c7e0a26bdab0b56e8beed3268b225250","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"repo":{"id":103684227,"name":"jetty.project","full_name":"jglick/jetty.project","owner":{"login":"jglick","id":154109,"avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jglick/jetty.project","description":"Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more","fork":true,"url":"https://api.github.com/repos/jglick/jetty.project","forks_url":"https://api.github.com/repos/jglick/jetty.project/forks","keys_url":"https://api.github.com/repos/jglick/jetty.project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jglick/jetty.project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jglick/jetty.project/teams","hooks_url":"https://api.github.com/repos/jglick/jetty.project/hooks","issue_events_url":"https://api.github.com/repos/jglick/jetty.project/issues/events{/number}","events_url":"https://api.github.com/repos/jglick/jetty.project/events","assignees_url":"https://api.github.com/repos/jglick/jetty.project/assignees{/user}","branches_url":"https://api.github.com/repos/jglick/jetty.project/branches{/branch}","tags_url":"https://api.github.com/repos/jglick/jetty.project/tags","blobs_url":"https://api.github.com/repos/jglick/jetty.project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jglick/jetty.project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jglick/jetty.project/git/refs{/sha}","trees_url":"https://api.github.com/repos/jglick/jetty.project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jglick/jetty.project/statuses/{sha}","languages_url":"https://api.github.com/repos/jglick/jetty.project/languages","stargazers_url":"https://api.github.com/repos/jglick/jetty.project/stargazers","contributors_url":"https://api.github.com/repos/jglick/jetty.project/contributors","subscribers_url":"https://api.github.com/repos/jglick/jetty.project/subscribers","subscription_url":"https://api.github.com/repos/jglick/jetty.project/subscription","commits_url":"https://api.github.com/repos/jglick/jetty.project/commits{/sha}","git_commits_url":"https://api.github.com/repos/jglick/jetty.project/git/commits{/sha}","comments_url":"https://api.github.com/repos/jglick/jetty.project/comments{/number}","issue_comment_url":"https://api.github.com/repos/jglick/jetty.project/issues/comments{/number}","contents_url":"https://api.github.com/repos/jglick/jetty.project/contents/{+path}","compare_url":"https://api.github.com/repos/jglick/jetty.project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jglick/jetty.project/merges","archive_url":"https://api.github.com/repos/jglick/jetty.project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jglick/jetty.project/downloads","issues_url":"https://api.github.com/repos/jglick/jetty.project/issues{/number}","pulls_url":"https://api.github.com/repos/jglick/jetty.project/pulls{/number}","milestones_url":"https://api.github.com/repos/jglick/jetty.project/milestones{/number}","notifications_url":"https://api.github.com/repos/jglick/jetty.project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jglick/jetty.project/labels{/name}","releases_url":"https://api.github.com/repos/jglick/jetty.project/releases{/id}","deployments_url":"https://api.github.com/repos/jglick/jetty.project/deployments","created_at":"2017-09-15T17:34:23Z","updated_at":"2017-09-15T17:34:38Z","pushed_at":"2017-09-19T16:30:04Z","git_url":"git://github.com/jglick/jetty.project.git","ssh_url":"git@github.com:jglick/jetty.project.git","clone_url":"https://github.com/jglick/jetty.project.git","svn_url":"https://github.com/jglick/jetty.project","homepage":"https://www.eclipse.org/jetty","size":102298,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"jetty-9.4.x"}},"base":{"label":"eclipse:jetty-9.4.x","ref":"jetty-9.4.x","sha":"3d5f06d05dc1e734f370cd204b9d3ae43497c33b","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":2045207,"name":"jetty.project","full_name":"eclipse/jetty.project","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/jetty.project","description":"Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more","fork":false,"url":"https://api.github.com/repos/eclipse/jetty.project","forks_url":"https://api.github.com/repos/eclipse/jetty.project/forks","keys_url":"https://api.github.com/repos/eclipse/jetty.project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/jetty.project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/jetty.project/teams","hooks_url":"https://api.github.com/repos/eclipse/jetty.project/hooks","issue_events_url":"https://api.github.com/repos/eclipse/jetty.project/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/jetty.project/events","assignees_url":"https://api.github.com/repos/eclipse/jetty.project/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/jetty.project/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/jetty.project/tags","blobs_url":"https://api.github.com/repos/eclipse/jetty.project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/jetty.project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/jetty.project/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/jetty.project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/jetty.project/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/jetty.project/languages","stargazers_url":"https://api.github.com/repos/eclipse/jetty.project/stargazers","contributors_url":"https://api.github.com/repos/eclipse/jetty.project/contributors","subscribers_url":"https://api.github.com/repos/eclipse/jetty.project/subscribers","subscription_url":"https://api.github.com/repos/eclipse/jetty.project/subscription","commits_url":"https://api.github.com/repos/eclipse/jetty.project/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/jetty.project/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/jetty.project/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/jetty.project/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/jetty.project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/jetty.project/merges","archive_url":"https://api.github.com/repos/eclipse/jetty.project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/jetty.project/downloads","issues_url":"https://api.github.com/repos/eclipse/jetty.project/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/jetty.project/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/jetty.project/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/jetty.project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/jetty.project/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/jetty.project/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/jetty.project/deployments","created_at":"2011-07-14T01:11:57Z","updated_at":"2017-09-25T05:45:49Z","pushed_at":"2017-09-25T18:54:36Z","git_url":"git://github.com/eclipse/jetty.project.git","ssh_url":"git@github.com:eclipse/jetty.project.git","clone_url":"https://github.com/eclipse/jetty.project.git","svn_url":"https://github.com/eclipse/jetty.project","homepage":"https://www.eclipse.org/jetty","size":103707,"stargazers_count":1589,"watchers_count":1589,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1007,"mirror_url":null,"open_issues_count":325,"forks":1007,"open_issues":325,"watchers":1589,"default_branch":"jetty-9.4.x"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824"},"html":{"href":"https://github.com/eclipse/jetty.project/pull/1824"},"issue":{"href":"https://api.github.com/repos/eclipse/jetty.project/issues/1824"},"comments":{"href":"https://api.github.com/repos/eclipse/jetty.project/issues/1824/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/jetty.project/pulls/1824/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/jetty.project/statuses/8aa954a3c7e0a26bdab0b56e8beed3268b225250"}},"author_association":"NONE"}}
{"actor":{"display_login":"jglick"}}