dschneider-pivotal commented on a change in pull request #7417:
URL: https://github.com/apache/geode/pull/7417#discussion_r820935068



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java
##########
@@ -61,20 +62,35 @@ public RedisList() {
   }
 
   /**
-   * @param elementsToAdd elements to add to this set; NOTE this list may by 
modified by this call
+   * @param elementsToAdd elements to add to this list; NOTE this list may be 
modified by this call
    * @param region the region this instance is stored in
-   * @param key the name of the set to add to
+   * @param key the name of the list to add to
    * @param onlyIfExists if true then the elements should only be added if the 
key already exists
    *        and holds a list, otherwise no operation is performed.
    * @return the length of the list after the operation
    */
-  public long lpush(List<byte[]> elementsToAdd, Region<RedisKey, RedisData> 
region, RedisKey key,
-      final boolean onlyIfExists) {
-    elementsPush(elementsToAdd);
+  public synchronized long lpush(List<byte[]> elementsToAdd, Region<RedisKey, 
RedisData> region,
+      RedisKey key, final boolean onlyIfExists) {
+    elementsPushHead(elementsToAdd);
     storeChanges(region, key, new AddByteArrays(elementsToAdd));
     return elementList.size();
   }
 
+  /**
+   * @param elementsToAdd elements to add to this list; NOTE this list may be 
modified by this call
+   * @param region the region this instance is stored in
+   * @param key the name of the list to add to
+   * @param onlyIfExists if true then the elements should only be added if the 
key already exists
+   *        and holds a list, otherwise no operation is performed.
+   * @return the length of the list after the operation
+   */
+  public synchronized long rpush(List<byte[]> elementsToAdd, Region<RedisKey, 
RedisData> region,

Review comment:
       what is the reason for syncing lpush and rpush? I thought we had figured 
out syncing on storeChanges could cause hangs and that we needed to have a 
version counter.




-- 
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: notifications-unsubscr...@geode.apache.org

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


Reply via email to