Thanks a lot for the inputs. I'll try out the new client approach. Best, Paul Lam
Patrick Duin <patd...@gmail.com> 于2021年9月29日周三 下午5:54写道: > In some of our tools we used to interact with the metastore we've moved > away from long running clients altogether the thrift protocol is best > served by just creating a new client for a request. Try to just create a > new client every time. They are fast to make. > They metastore clients are also not thread safe so if you're sharing among > concurrent requests you'll have troubles already. > > Op wo 29 sep. 2021 om 09:04 schreef Paul Lam <paullin3...@gmail.com>: > >> Hi community, >> >> I have a long-running IMetaStoreClient that would queries metadata upon >> user requests. But the connection would be lost sometimes because of server >> restarts or network unstablity, which leads to SocketException when >> accessing Metastore. >> >> I noticed there’s a #reconnect method, which closes the current thrift >> connection and opens a new one. Is that designed for this scenario? Or is >> there some best practice to handle the connectivity issue? >> >> In addition, I’m using Hive 1.1.0-CDH5.6.0 and Apache Hive 2.3.0 (in >> migrating process). >> >> Thanks a lot! >> >> Best, >> Paul Lam >> >>