Skip to content
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

GEODE-9019: Fixed synchronization blocks missed in previous commit #6123

Merged

Conversation

nabarunnag
Copy link
Contributor

Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Note:

Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.

@nabarunnag
Copy link
Contributor Author

In a previous commit I missed out the synchronized block for toData in RedisHash and RedisSet, but then noticed that RedisString will also now require the synchronized block.

@@ -615,7 +615,7 @@ public int setbit(
*/

@Override
public void toData(DataOutput out, SerializationContext context) throws IOException {
public synchronized void toData(DataOutput out, SerializationContext context) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's just toData in for RedisString, I believe other methods need to be synchronized as well (like RedisHash and RedisSet do).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it would be nice to have a failing test for this if possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are a couple of confirmSerializationIsStable tests and testSerializables. Is there any specific feature that you - like me to check in a test?
  • Also, in this commit, I was just primarily undoing the removal of the synchronized blocks that I missed in the previous commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create another ticket to figure out which other methods are not synchronized and fix those. This commit is just to undo the synchronizied commits I missed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are a couple of confirmSerializationIsStable tests and testSerializables. Is there any specific feature that you - like me to check in a test?
  • added tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will approve this PR with the understanding that there will be another fix to synchronize the rest of the memthods in RedisString.

When I was talking about tests, I meant tests that show that we actually need synchronization. Like a test that shows data corruption if we don't have synchronization. I'm not sure there is much value in programatically testing that the method has a synchronization modifier.

@nabarunnag nabarunnag changed the title GEODE-9019: Fixed missing synchronization blocks GEODE-9019: Fixed missing synchronization blocks missed in previous commit Mar 12, 2021
@nabarunnag nabarunnag changed the title GEODE-9019: Fixed missing synchronization blocks missed in previous commit GEODE-9019: Fixed synchronization blocks missed in previous commit Mar 12, 2021
Copy link
Contributor

@jdeppe-pivotal jdeppe-pivotal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for replacing the synchronized blocks. We do have a test - CrashAndNoRepeatDUnitTest, that tests APPEND when systems are failing. It hasn't failed yet with issues so we'll probably need a test that exercises this class directly for concurrency issues. We'll probably at least need to synchronize append().

@nabarunnag nabarunnag merged commit 0b9c6b1 into apache:develop Mar 17, 2021
nabarunnag added a commit to nabarunnag/geode that referenced this pull request Mar 17, 2021
…pache#6123)

* Added tests to validate synchronized modifiers.
* Enum serialization fixed, comments updated

(cherry picked from commit 0b9c6b1)
nabarunnag added a commit that referenced this pull request Mar 19, 2021
GEODE-9019: Serialization improvements in geode-redis (#6115)

   * DataSerializable classes were converted in DataSerializableFixedID
   * serialVersionID were added to the unavoidable Serializable classes

GEODE-9019: Fixed synchronization blocks missed in previous commit  (#6123)

* Added tests to validate synchronized modifiers.
* Enum serialization fixed, comments updated
* Fixed the pom error - geode-membership in geode-redis

(cherry picked from commit 7aae7b8)
(cherry picked from commit 0b9c6b1)
pivotal-eshu pushed a commit to agingade/geode that referenced this pull request Mar 30, 2021
…pache#6123)

* Added tests to validate synchronized modifiers.
* Enum serialization fixed, comments updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants