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

ISPN-5797 NullPointerException in ClientListenerRegistry under load #3743

Closed
wants to merge 1 commit into from

Conversation

wburns
Copy link
Member

@wburns wburns commented Oct 6, 2015

  • Made sure null value and metadata are supported

https://issues.jboss.org/browse/ISPN-5797

@@ -183,8 +183,12 @@ class ClientListenerRegistry(configuration: HotRodServerConfiguration) extends L
@CacheEntryExpired
def onCacheEvent(event: CacheEntryEvent[Bytes, Bytes]) {
if (isSendEvent(event)) {
val dataVersion = event.getMetadata.version().asInstanceOf[NumericVersion].getVersion
sendEvent(event.getKey, event.getValue, dataVersion, event)
sendEvent(event.getKey, event.getValue, if (event.getMetadata == null) {

Choose a reason for hiding this comment

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

Minor: the 3rd param to sendEvent could be written in a more functional way as:

Option(event.getMetadata)
      .map(_.version().asInstanceOf[NumericVersion].getVersion)
      .getOrElse(null.asInstanceOf[Long])

It'd be nicer without the ugly casts, but this cast is around in several places. It assumes NumericVersion is always used, so I wonder if there's a valid use case for setting SIMPLE versioning scheme on the server. If so, it'd break in several places. Not related to this PR anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, I will update it. The issue is not with having versioning enabled or not. The problem is that there are some cases where the metadata and value are not available from an expiration event and thus we have to handle those null values.

* Made sure null value and metadata are supported
@wburns
Copy link
Member Author

wburns commented Oct 7, 2015

Updated per comments.

@wburns
Copy link
Member Author

wburns commented Oct 7, 2015

This needs to also be cherry-picked into 8.0.x branch

@gustavocoding
Copy link

pulling

@gustavocoding
Copy link

Integrated in master and 8.0.x, thanks @wburns !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants