NIFI-13146 ConsumeSlack rate limit error mitigation#8748
NIFI-13146 ConsumeSlack rate limit error mitigation#8748markap14 merged 1 commit intoapache:mainfrom
Conversation
| //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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.
|
@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. |
|
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. |
Co-authored-by: Krisztina Zsihovszki <kzsihovszki@cloudera.com>
Co-authored-by: Krisztina Zsihovszki <kzsihovszki@cloudera.com>
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
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkUI Contributions
Licensing
LICENSEandNOTICEfilesDocumentation