projectbuendia / buendia

Main project repository (see the Wiki for details)
Apache License 2.0
117 stars 36 forks source link

Discard HTTP sessions during RestController.finish() #241

Closed schuyler closed 4 years ago

schuyler commented 4 years ago

Since REST clients don't reuse Java servlet HTTP sessions, make sure that we always invalidate the current session (if any), to prevent the session cache from filling up and bogging down the servlet container.

Tested using tools/stress and jmap -histo:live as described in the comments to #225. The jmap output looks good after 11,000 requests, and request response times are nominal.

Has no impact on regular user logins via the web interface. Tested by logging into OpenMRS and then waiting 20 minutes to see if I was still logged in, as expected.

Ran the integration tests manually in Vagrant. All pass.

Fixes #225 hopefully once and for all.

zestyping commented 4 years ago

Awesome! Thanks for the long battle on this one!