Query cancellation & timeout

also, that should go into java util I think