[ 
https://issues.apache.org/jira/browse/KAFKA-16063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17801577#comment-17801577
 ] 

Divij Vaidya commented on KAFKA-16063:
--------------------------------------

Nice find and yes, disabling shutdown hook sounds like a plan.

I am curious though, if the map is not cleared during stop function, then who 
clears it? As an alternative solution, should we instead clear the map in stop 
function? This would ensure that even if we forget to call stop, on process 
exit, kdc will stop definitely due to the hooks.

> Fix leaked ApplicationShutdownHooks in EndToEndAuthorizationTests
> -----------------------------------------------------------------
>
>                 Key: KAFKA-16063
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16063
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Divij Vaidya
>            Assignee: Arpit Goyal
>            Priority: Major
>         Attachments: Screenshot 2023-12-29 at 12.38.29.png, Screenshot 
> 2023-12-31 at 7.19.25 AM.png, Screenshot 2024-01-01 at 10.51.03 PM-1.png, 
> Screenshot 2024-01-01 at 10.51.03 PM.png
>
>
> All test extending `EndToEndAuthorizationTest` are leaking 
> DefaultDirectoryService objects.
> This can be observed using the heap dump at 
> [https://www.dropbox.com/scl/fi/4jaq8rowkmijaoj7ec1nm/GradleWorkerMain_10311_27_12_2023_13_37_08_Leak_Suspects.zip?rlkey=minkbvopb0c65m5wryqw234xb&dl=0]
>  (unzip this and you will find a hprof which can be opened with your 
> favourite heap analyzer)
> The stack trace looks like this:
> !Screenshot 2023-12-29 at 12.38.29.png!
>  
> I suspect that the reason is because DefaultDirectoryService#startup() 
> registers a shutdownhook which is somehow messed up by 
> QuorumTestHarness#teardown().
> We need to investigate why this is leaking and fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to