Hi,

in my experience, the call to cleanup() is very unreliable... When
killing a topology, the worker process is killed via "kill -9" command
what is very harsh and cleanup() is not called most times (in my
experience).

If you want to make sure that DB connections are closed, I would follow
Nathan's suggestions to sent a special notification tuple through the
topology that is triggered by "deactivate".

-Matthias


On 05/13/2015 03:20 PM, Jeffery Maass wrote:
> Bolts which implement IBolt have a method called cleanup() which is
> called by the Storm framework.
> 
> https://storm.apache.org/apidocs/backtype/storm/task/IBolt.html
> 
> It is not guaranteed to be called, but then again, neither is any custom
> code you write to perform the same functionality.
> 
> 
> Thank you for your time!
> 
> +++++++++++++++++++++
> Jeff Maass <mailto:maas...@gmail.com>
> linkedin.com/in/jeffmaass <http://linkedin.com/in/jeffmaass>
> stackoverflow.com/users/373418/maassql
> <http://stackoverflow.com/users/373418/maassql>
> +++++++++++++++++++++
> 
> 
> On Wed, May 13, 2015 at 6:23 AM, Richards Peter <hbkricha...@gmail.com
> <mailto:hbkricha...@gmail.com>> wrote:
> 
>     Hi,
> 
>     I am using storm-0.8.2 in my system.  My project, based on storm,
>     opens connections to database/cache-server from  spout/bolts. I need
>     some of the connections to remain open till the topologies are
>     active. However I would like to release these open connections from
>     spout/bolt code when I kill my topology.
> 
>     Could you please tell me how the resources(cache-server or database
>     connections) in bolts/spouts can be released using storm 0.9.3 and
>     higher versions?
> 
>     I am planning to upgrade storm, used in my project, to storm-0.9.4
>     for various reasons. If I can release resources (cache-server or
>     database connections) from spout and bolt, it would another good
>     reason for storm upgrade.
> 
>     Thanks,
>     Richards Peter.
> 
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to