Skip to content

NIFI-13146 ConsumeSlack rate limit error mitigation#8748

Merged
markap14 merged 1 commit intoapache:mainfrom
krisztina-zsihovszki:NIFI-13146
May 9, 2024
Merged

NIFI-13146 ConsumeSlack rate limit error mitigation#8748
markap14 merged 1 commit intoapache:mainfrom
krisztina-zsihovszki:NIFI-13146

Conversation

@krisztina-zsihovszki
Copy link
Contributor

Summary

NIFI-13146

ConsumeSlack processor got stuck in initialization phase and reported rate limit error continuously when it was running in a Slack workplace with thousands of channels.

As a mitigation for the problem I added a logic which checks if "Channels" property contains only IDs. In case no channel name is specified, another Slack API call (conversations.info) is used to fetch the channel names for the channel IDs and no need to fetch the whole conversation list.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • [x ] JDK 21

UI Contributions

  • NiFi is modernizing its UI. Any contributions that update the current UI also need to be implemented in the new UI.

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

//resolve the channel names by the specified channel IDs
for (String channelId : channels) {
String channelName = client.fetchChannelName(channelId);
getLogger().info("Resolved Channel ID {} to name {}", channelId, channelName);
Copy link
Contributor

@dan-s1 dan-s1 May 6, 2024

Choose a reason for hiding this comment

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

I am not sure the possible number of channels but it does not seem right to have so many log statements on info level here, line 285 and line 294.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dan-s1 Thank you for the comment.
The info logging on line 285 and line 294 were added to the original implementation, I just moved the block, on line 268 I tried to follow the original logging method in the new code.

I think there won't be so many channels consumed at the same time, but I am open to change the level of logging to debug.

@krisztina-zsihovszki
Copy link
Contributor Author

@markap14 If you have free cycles, can you please check this PR? You created the original implementation, do you think this modification makes sense? Thanks.

@markap14
Copy link
Contributor

markap14 commented May 9, 2024

Thanks @krisztina-zsihovszki the changes seems reasonable. Contrib-check looks good, and I was able to verify behavior using both ID's and channel names. +1 will merge.

@markap14 markap14 merged commit 5a3b473 into apache:main May 9, 2024
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
Co-authored-by: Krisztina Zsihovszki <kzsihovszki@cloudera.com>
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
Co-authored-by: Krisztina Zsihovszki <kzsihovszki@cloudera.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants