ji-seung-ryu opened a new pull request, #19786:
URL: https://github.com/apache/kafka/pull/19786

   jira: 
[https://issues.apache.org/jira/browse/KAFKA-19268](https://issues.apache.org/jira/browse/KAFKA-19268)
   
   In jira, there are 5 unit 
tests(testAcknowledgeCompletesDelayedShareFetchRequest, 
testMultipleConcurrentShareFetches
   testCachedTopicPartitionsForValidShareSessions, 
testReleaseSessionCompletesDelayedShareFetchRequest, testReleaseSessionSuccess) 
that print exceptions. 
   
   **testAcknowledgeCompletesDelayedShareFetchRequest**
   
   [problem]
   
   - buildLogReadResult was programmed to return list of tp1, tp2 .
   - readFromLog should return only list of topic partitions that will be 
acknowleged, otherwise error occurs.
   
   [solution]
   - Make buildLogReadResult return list of tp1 which will be acknowleged.
   
   **testMultipleConcurrentShareFetches**
   
   [problem]
   - buildlogReadResult had no records which leads to error in 
maybeSliceFetchRecords. 
   - java.util.NoSuchElementException: null
        at 
org.apache.kafka.common.utils.AbstractIterator.next(AbstractIterator.java:52) 
~[kafka-clients-4.1.0-SNAPSHOT.jar:?]
        at 
kafka.server.share.ShareFetchUtils.maybeSliceFetchRecords(ShareFetchUtils.java:219)
 [main/:?]
        at 
kafka.server.share.ShareFetchUtils.processFetchResponse(ShareFetchUtils.java:132)
 [main/:?]
   
   [solution]
   - I add buildLogReadResultWithFakeRecords which has records. 
   - Though above addition makes the test pass well, still not sure doAnswer 
chaning (line 1075 ~ 1105) works well in multi threading test. Even though I 
changed values of assertEquals in doAnswer chaining to random value, test 
passed as well. It needs to be checked that chaining works well even in multi 
thread test.
   
   
   **testCachedTopicPartitionsForValidShareSessions**
   
   [problem]
   - ReleaseAcquiredRecords mocks missed.
   - SharePartitionManager didn't have right partitionCache. 
   
   [solution]
   - Above two things are added.
   
   **testReleaseSessionCompletesDelayedShareFetchRequest**
   
   [problem]
   - tp3 is not in sharePartitionManager's partition cache. 
   - In test code, it tries to release tp3 by 
'sharePartitionManager.releaseSession(groupId, memberId);' which leads to 
exception.
   
   [solution]
   - I haven't added nothing since this exception was intended.
   - Printing exeption looks bad though. 
   
   **testReleaseSessionSuccess**
   
   [problem]
   - tp3 is not in sharePartitionManager's partition cache. 
   - In test code, it tries to release tp3 by 
'sharePartitionManager.releaseSession(groupId, memberId.toString());' which 
leads to exception.
   
   [solution]
   - I haven't added nothing since this exception was intended.
   - Printing exeption looks bad though. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to