Skip to content


Subversion checkout URL

You can clone with
Download ZIP


RequestVar cleanup not being called when request ends #1160

indrajitr opened this Issue · 1 comment

5 participants


Hi David,

Am reporting bug [[url:!searchin/liftweb/noel/liftweb/1_7JAJwAfto/Ktjn_W_kDtAJ|as requested]].

My problem is that RequestVar cleanupFunc doesn't run at the end of each http request, which is resulting in a memory leak for my usage:

I'm using a RequestVar to provide a service which needs to be disposed of correctly when it is no longer needed, ie it is not advised to leave it to the garbage collector to tidy up. Therefore I registered the RequestVar to clean up after use via the registerCleanupFunc .
However, the behaviour I'm seeing is that for the first use only (1st http request) the service is shutdown correctly. Any usages after this don't seem to be clean up properly, ie the lambda I passed to registerCleanupFunc isnt being called again.

Here is my code:

object HttpDispatchConnection extends RequestVarHttp {
registerCleanupFunc(ignore => is.shutdown())

@dpp dpp was assigned
@dpp dpp was unassigned by Shadowfiend
@Shadowfiend Shadowfiend self-assigned this
@Shadowfiend Shadowfiend added this to the 3.0-M1 milestone
@farmdawgnation farmdawgnation modified the milestone: 3.0-M2, 3.0-M3
@Shadowfiend Shadowfiend modified the milestone: 3.0-M3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.