You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/09/06 15:12:30 UTC

[GitHub] [jackrabbit-oak] mreutegg opened a new pull request #361: OAK-9565: NullPointerException on Session.logout()

mreutegg opened a new pull request #361:
URL: https://github.com/apache/jackrabbit-oak/pull/361


   Test case with proposed fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jackrabbit-oak] mreutegg merged pull request #361: OAK-9565: NullPointerException on Session.logout()

Posted by GitBox <gi...@apache.org>.
mreutegg merged pull request #361:
URL: https://github.com/apache/jackrabbit-oak/pull/361


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jackrabbit-oak] stefan-egli commented on a change in pull request #361: OAK-9565: NullPointerException on Session.logout()

Posted by GitBox <gi...@apache.org>.
stefan-egli commented on a change in pull request #361:
URL: https://github.com/apache/jackrabbit-oak/pull/361#discussion_r703356040



##########
File path: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/SessionLogoutTest.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.session;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+
+public class SessionLogoutTest extends AbstractJCRTest {
+
+    public void testConcurrentSessionLogout() throws Exception {
+        Session s = getHelper().getReadWriteSession();
+        List<Exception> exceptions = new ArrayList<>();

Review comment:
       (Just a note to self: I was first wondering whether you'd need a concurrent version of List (eg ConcurrentLinkedQueue) - but Thread.join indeed, and somewhat obviously, honours the ['happens-before order' ](https://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4.5), so this works perfectly fine.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jackrabbit-oak] mreutegg commented on pull request #361: OAK-9565: NullPointerException on Session.logout()

Posted by GitBox <gi...@apache.org>.
mreutegg commented on pull request #361:
URL: https://github.com/apache/jackrabbit-oak/pull/361#issuecomment-914139367


   `SessionStatsTest.testInitStackTraceEnabledAfterOpeningManySessions` fails because of a side effect of the new `SessionLogoutTest`. The new test provokes the issue described in OAK-9262. The initStackTrace feature and the test depends on a correct session counter, which is violated when `SessionLogoutTest` runs.
   
   I'm going to change the fix to also include OAK-9262.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #361: OAK-9565: NullPointerException on Session.logout()

Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #361:
URL: https://github.com/apache/jackrabbit-oak/pull/361#discussion_r703361700



##########
File path: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/session/SessionLogoutTest.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.session;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+
+public class SessionLogoutTest extends AbstractJCRTest {
+
+    public void testConcurrentSessionLogout() throws Exception {
+        Session s = getHelper().getReadWriteSession();
+        List<Exception> exceptions = new ArrayList<>();

Review comment:
       Hmm, right. But the List must still be thread-safe, which is currently not the case. Multiple threads may add exceptions to the list concurrently in the failure case. I'm going to change that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org