EJB Container Lazy Deserialization Handling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
During Zero Downtime Patching in application server environments, lazy deserialization exceptions occur when stateful EJBs' states are replicated from patched to unpatched servers or vice versa, leading to deserialization failures due to incompatible Java serialization changes, resulting in potential session loss and downtime.
Innovation Solution
The system detects such instances and replicates the bean state to a new secondary server in the opposite failover server group, setting a remote reference exception that carries the replica's remote reference to the client side, enabling lazy deserialization to fulfill client requests.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If stateful EJB state is replicated from patched server to unpatched server during Zero Downtime Patching, then patching can proceed with minimal downtime, but deserialization failures occur due to incompatible Java serialization changes
Solution Approach 1:
The system performs preliminary actions by detecting deserialization incompatibility before it causes failure. The container checks whether the current server can deserialize the replicated state, and if not, proactively redirects the client request to an appropriate server that can handle the deserialization, preventing the failure before it occurs.
Solution Approach 2:
The EJB container acts as an intermediary between the client and the server. When deserialization incompatibility is detected, the container intercepts the client request and redirects it to a suitable server (either the original primary or an alternative), mediating the interaction to ensure successful deserialization while maintaining the illusion of continuous service for the client.
2Productivity
If lazy deserialization is used to delay deserialization until client request, then server can proceed with patching, but deserialization exceptions occur when incompatible state is accessed
Solution Approach 1:
The system implements self-service by enabling the client stub to automatically detect and handle deserialization exceptions. When a deserialization exception occurs, the stub autonomously redirects the request to an appropriate server without requiring manual intervention, allowing the patching process to continue while maintaining session integrity.
Solution Approach 2:
The system uses feedback mechanisms where deserialization exceptions serve as signals that trigger automatic redirection. The exception feedback from the deserialization process informs the client stub that the current server cannot handle the state, prompting the stub to seek an alternative server that can successfully deserialize the state.
3Productivity
If deserialization is attempted on server with incompatible patch level, then patching can proceed, but session loss occurs due to deserialization failure
Solution Approach 1:
The system performs preliminary detection of deserialization compatibility before session data is lost. The container checks whether the server can deserialize the replicated state, and if not, proactively redirects the client request to an appropriate server, preventing session data loss before it occurs.
Solution Approach 2:
The system provides beforehand cushioning by having the client stub ready with redirection logic to handle deserialization failures. This preparatory measure ensures that if deserialization fails on one server, the client can immediately be redirected to an alternative server, cushioning against potential session data loss.
Data Source
AI summary
In accordance with an embodiment, described herein is a system and method for handling lazy deserialization exceptions in an application server environment. When a stateful, e.g., EJB client request arrives to the EJB container, if the container detects that it cannot deserialize the state on this server and a patching (Patching, Zero Downtime Patching, ZDT) application upgrade rollout is in progress, the container can ask the replication manager to replicate the bean state to a new secondary that is in the opposite ZDT failover server group of this server, if it can find one. A remote reference of the replica on the new secondary will be set to a special type exception, which carries the replica's remote reference to the client side, in order to fulfill the client request.


