Gemfire WAN hangs because of custom deserializer
search cancel

Gemfire WAN hangs because of custom deserializer

book

Article ID: 294078

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

Symptoms:

If customer deserializers are registered programatically, gemfire wan hangs and causes issues like max-connection reached and will stop accepting new client connections.

public class MyCustomSerializer extends com.gemstone.gemfire.DataSerializer{
static {
DataSerializer.register(MyCustomSerializer.class);
}
public JodaTimeDataSerializer() {
}

@Override
public Class<?>[] getSupportedClasses() {
return new Class<?>[] {DateTime.class};
}

@Override
public boolean toData(Object o, DataOutput dataOutput) throws IOException {
if (o instanceof DateTime) {
//custom implementation
}
return false;
}

@Override
public Object fromData(DataInput dataInput) throws IOException, ClassNotFoundException {
// custom implementation
}
@Override
public int getId() {
return 987234234;
}
}

Environment


Cause

It causes a distributed deadlock during custom deserializer registration process at two wan sites.

Resolution

The solution is basically to the custom deserializer is use <serialization-registration> tag instead of programatically registering it. This is the recommended approach.

<serialization-registration>
<serializer>
<class-name>com.sample.MyCustomDataSerializerclass-name>
</serializer>
</serialization-registration>