cubewise-code / tm1py

TM1py is a Python package that wraps the TM1 REST API in a simple to use library.
http://tm1py.readthedocs.io/en/latest/
MIT License
187 stars 107 forks source link

REST Sessions do not end if script is killed #29

Closed kool2zero closed 5 years ago

kool2zero commented 6 years ago

We are testing the code to multithread the execution of processes and we noticed that if the script is ended, it will not disconnect the threads (leaving all the rest threads out there idle). Is there a way to sense the kill and handle the disconnect in the script?

MariusWirtz commented 6 years ago

How do you kill it? You mean killing the running python process through taskkill? If the scripts ends naturally would it clean up all the sessions?

As a Fallback you could set a low value for HTTPSessionTimeoutMinutes parameter in the tm1s.cfg.

kool2zero commented 6 years ago

Correct. Killing the python process through task kill... If the script ends naturally, it will clean up the sessions. I will try the HTTPSessionTimeoutMinutes.

kool2zero commented 6 years ago

It does not appear to work in 10.2.2 FP7 for this use case.

MariusWirtz commented 6 years ago

Strange. I would expect the TM1 Server to handle it and clean up the sessions, that are timed out.

ajmyers commented 6 years ago

I've also encountered issues with HTTPSessionTimeoutMinutes not working correctly in 10.2.2 FP6 as well, I think it may be fixed in one of the Planning Analytics releases.

MariusWirtz commented 5 years ago

Problem fixed in TM1 11 / PA