Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Gateway senders drop all events received when they are stopped. Nevertheless, primary gateway senders, while stopped, store all events received in the ```tmpDroppedEvents``` tmpDroppedEvents member variable of the ```AbstractGatewaySender``` AbstractGatewaySender class. These events are stored so that they can be sent later (when the primary gateway sender is started) to the secondary gateway senders in order for them to remove those events from their queues. If it were not so, secondary gateway senders could have events in their queues that would never be removed.

...

This solution works well when stopped gateway senders are not to remain in that state for a long time, e.g., when they are stopped but in the process of starting. But, if a gateway sender is stopped (for example using gfsh) to be left in that state for some time, the incoming events reaching the primary gateway senders will be stored in the mentioned member variable of ```AbstractGatewaySender``` AbstractGatewaySender and eventually will provoke a heap exhaustion error. Moreover, dropped events stored while the gateway sender is stopped will not be queued by secondary gateway senders which makes the storing of the dropped events in the primary gateway sender unnecessary.

...

In order to do so, it is proposed to add a new boolean member variable in the ```AbstractGatewaySender``` AbstractGatewaySender that will tell if the primary gateway sender must store dropped events or not.

This flag will be set to false (do not store dropped events) in all gateway sender instances (primary and secondaries) after a ```stop stop gateway sender``` sender command using gfsh has successfully completed. And this flag will be set to true in all gateway sender instances (primary and secondaries) as a prior step to the ```start start gateway sender``` sender gfsh command.

A draft PR of the solution can be found here: https://github.com/apache/geode/pull/5348

...

As the proposal implies changing the implementation of the gfsh ```start start gateway sender``` sender and  the ```stop stop gateway sender``` sender commands to be done in two steps, these commands may be slightly slower but not significantly.

...