lightblue-platform / lightblue-migrator

GNU General Public License v3.0
3 stars 13 forks source link

facade: start timeout for LB calls after oracle call returns #369

Open bserdar opened 8 years ago

bserdar commented 8 years ago

When both LB and oracle calls are started at the same time, applying a 2sec timeout to LB calls is not fair when oracle call takes longer to complete. Instead, the 2 sec timeout should start after oracle call returns. I think if we issue LB call on a separate thread, then issue the oracle call, and when oracle call returns wait for 2 secs before logging a slow call, this can be done.

paterczm commented 8 years ago

I agree and I think I know how to implement it, after dealing with initial confusion. How about max(2s, ) instead of +2s?

We can also try to interrupt the tread after timeout using https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html#cancel(boolean).

paterczm commented 8 years ago

https://github.com/lightblue-platform/lightblue-migrator/pull/370

paterczm commented 8 years ago

https://github.com/lightblue-platform/lightblue-migrator/pull/371