Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Bug Fix 1804 #960

Merged
merged 15 commits into from
Oct 15, 2018
Merged

Bug Fix 1804 #960

merged 15 commits into from
Oct 15, 2018

Conversation

Kunal-Jha
Copy link
Contributor

@Kunal-Jha Kunal-Jha commented Sep 26, 2018

One-line summary

Zalando ticket : ARUHA-1804

Description

In case of the requesting stats for subscription with stale offsets and show_time_lag, unreported status code is displayed.
Goal: Instead all the stats till the timeout should be returned
Ticket

@Kunal-Jha Kunal-Jha requested a review from a team as a code owner September 26, 2018 15:02
@codecov-io
Copy link

codecov-io commented Sep 27, 2018

Codecov Report

Merging #960 into master will increase coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #960      +/-   ##
============================================
+ Coverage     54.06%   54.08%   +0.02%     
  Complexity     1758     1758              
============================================
  Files           320      318       -2     
  Lines          9602     9589      -13     
  Branches        873      872       -1     
============================================
- Hits           5191     5186       -5     
+ Misses         4093     4086       -7     
+ Partials        318      317       -1
Impacted Files Coverage Δ Complexity Δ
...kadi/service/subscription/SubscriptionService.java 72.98% <ø> (ø) 38 <0> (ø) ⬇️
...ando/nakadi/controller/SubscriptionController.java 76.19% <ø> (+6.62%) 7 <0> (ø) ⬇️
...g/zalando/nakadi/controller/ExceptionHandling.java 78.12% <ø> (+4.59%) 14 <0> (ø) ⬇️
...rvice/subscription/SubscriptionTimeLagService.java 79.1% <66.66%> (+1.32%) 11 <1> (ø) ⬇️
...ns/runtime/ErrorGettingCursorTimeLagException.java 0% <0%> (-80%) 0% <0%> (-1%)
...n/java/org/zalando/nakadi/service/EventStream.java 74.79% <0%> (+1.62%) 30% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 885a8c8...756fd9e. Read the comment docs.

@rcillo
Copy link
Contributor

rcillo commented Oct 4, 2018

@Kunal-Jha please, add some more information to the PR description and update it following the template. It should have the Jira ticket link as a minimum requirement, when there is a correspondent jira ticket.

If you don't have all the information required by the template, please delete such info from the template.

try {
timeLagFuture = timeLagHandler.getCursorTimeLagFuture(cursor);
} catch (TimeoutException e) {
LOG.error("Time lag request timed out");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this doesn't fix all possible problems regarding timeouts.

This exception you silenced here would be thrown in case the semaphore tryAcquire fails. But we could also have another timeout in case the future was successfully scheduled for execution but did not finish within the expected time.

This is handled by lines 88/95. So I think that a fix for this should make sure that it doesn't launch 422 in case of failed time lag computation, be it in the semaphore or the future by itself.

} catch (RejectedExecutionException|TimeoutException | ExecutionException e) {
LOG.warn("caught exception the timelag stats are not complete");
} catch (Throwable e){
LOG.warn("caught throwable the timelag stats are not complete");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, log the exception as well.

@rcillo
Copy link
Contributor

rcillo commented Oct 8, 2018

@Kunal-Jha now that we are no longer throwing those exception, I did a search in the project to see if they were used somewhere else and found out that they are handled by ExceptionHandling class. Since they are no longer thrown, I would request you to remove the exception handling from this class as well as delete the exception class itself.

@rcillo
Copy link
Contributor

rcillo commented Oct 12, 2018

@Kunal-Jha please, rebase/merge this branch and I'll approve.

@rcillo
Copy link
Contributor

rcillo commented Oct 12, 2018

👍

@Kunal-Jha
Copy link
Contributor Author

deploy validation please

@rcillo
Copy link
Contributor

rcillo commented Oct 15, 2018

@Kunal-Jha during validation I realised we forgot to update the documentation for this attribute. Please change the description for show_time_lag to better explain the behaviour. Right now it says show consumer time lag but this is not longer true. It might or might not show it depending on whether a problems happens (timeout or anything else). So we better write something like shows consumer time lag as an optional field. This option is time consuming and Nakadi attempts to compute it in a best effort strategy. In case Nakadi is not able to compute it within a configurable timeout, the field might not be present in the output.. But the final words are yours, this is just a suggestion.

@@ -1442,7 +1442,10 @@ paths:
- $ref: '#/parameters/SubscriptionId'
- name: show_time_lag
in: query
description: show consumer time lag
description: shows consumer time lag as an optional field.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to use the "|" for paragraphs in OpenAPI, please check an example where you can find description: |

@@ -1445,7 +1445,8 @@ paths:
description: shows consumer time lag as an optional field.
This option is a time consuming operation and Nakadi attempts to compute it in the best possible strategy.
In cases of failures, resulting in Nakadi being unable to compute it within a configurable timeout,
the field might not be present in the output.
the field might either be partially present or not present (dependiong on the number of successful requests)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/dependiong/depending/

@@ -1442,10 +1442,11 @@ paths:
- $ref: '#/parameters/SubscriptionId'
- name: show_time_lag
in: query
description: shows consumer time lag as an optional field.
description: |
Shows consumer time lag as an optional field.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to ident the content with 2 extra spaces.

@rcillo
Copy link
Contributor

rcillo commented Oct 15, 2018

👍

1 similar comment
@Kunal-Jha
Copy link
Contributor Author

👍

@Kunal-Jha Kunal-Jha merged commit 3f65fd8 into master Oct 15, 2018
@Kunal-Jha Kunal-Jha deleted the aruha-1804-bugfix branch October 15, 2018 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants