Skip to content

Commit

Permalink
[AMORO-1857]: Check short name for principal before call constructUgi…
Browse files Browse the repository at this point in the history
…() (apache#1990)

* [AMORO-1857] Fix If the kerberos account information filled in during catalog creation is abbreviated, it will cause the FileSystem to be unable to hit the cache, constantly create new FileSystem instances without being garbage collected, eventually leading to an out of memory error (apache#1857)

* extract principal from username of ugi,and compare to krbPrincipal

* [AMORO-1857] Fix If the kerberos account information filled in during catalog creation is abbreviated, it will cause the FileSystem to be unable to hit the cache, constantly create new FileSystem instances without being garbage collected, eventually leading to an out of memory error (apache#1857)

* extract principal from username of ugi,and compare to krbPrincipal

* [AMORO-1857] Fix If the kerberos account information filled in during catalog creation is abbreviated, it will cause the FileSystem to be unable to hit the cache, constantly create new FileSystem instances without being garbage collected, eventually leading to an out of memory error (apache#1857)

* extract principal from username of ugi,and compare to krbPrincipal

---------

Co-authored-by: 罗旭 <luo.xu@trs.com.cn>
Co-authored-by: baiyangtx <xiangnebula@163.com>
  • Loading branch information
3 people authored and ShawHee committed Dec 29, 2023
1 parent f41a413 commit fd76fdb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ public synchronized UserGroupInformation getUGI() {
if (TableMetaStore.AUTH_METHOD_KERBEROS.equals(authMethod)) {
// re-construct
if (!ugi.getAuthenticationMethod().toString().equals(authMethod) ||
!ugi.getUserName().equals(krbPrincipal)) {
(!ugi.getUserName().equals(krbPrincipal) &&
!StringUtils.substringBefore(ugi.getUserName(),"@").equals(krbPrincipal))) {
try {
constructUgi();
LOG.info("Complete to re-build ugi {}", authInformation());
Expand Down

0 comments on commit fd76fdb

Please sign in to comment.