yugabyte/yugabyte-db

[Platform] Leaks of resources

Open

#6,586 建立於 2020年12月8日

在 GitHub 查看
 (7 留言) (0 反應) (0 負責人)C (1,003 fork)batch import
area/platformgood first issue

倉庫指標

Star
 (8,229 star)
PR 合併指標
 (平均合併 17天 21小時) (30 天內合併 92 個 PR)

描述

  1. UniverseTaskBase.java, isServerAlive(), absent ybService.closeClient();
  2. Universe.java, getMasterLeader(), it is better to put closeClient() into the finally block;
  3. SetFlagInMemory.java, run(), closeClient() could be missed in case of any exceptions raised after getClient() and before closeClient();
  4. WaitForServerReady.java, run(), it is better to put closeClient() into the finally block. Yes, it is almost impossible that ServerSubTaskBase.getHostPort() will throw an exception but actually this probability is not 0;
  5. SessionController.java, getLogs(), Resource leak: 'reader' is never closed;
  6. SwamperHelper.java, writeTargetJsonFile(), the file may stay opened (in case of file.write of file.flush throws an exception);
  7. CertificateHelper.java, createRootCA(), Resource leak: 'certWriter' is never closed, Resource leak: 'keyWriter' is never closed; createClientCertificate(), 'clientCertWriter' and 'clientKeyWriter' are never closed (in case when storagePath != null).

貢獻者指南