pdolif opened a new pull request, #14: URL: https://github.com/apache/pulsar-connectors/pull/14
Fixes #13 ### Motivation The polling interval of the `FileListingThread` might not always work as expected, and file listings might be skipped. After performing the file listing, the thread sleeps for `pollingInterval - 1` milliseconds only. Besides that, there is a check to see whether the elapsed time since the last run **exceeds** the polling interval. For example, if a polling interval of 100ms is used, the thread might sleep 99ms, but the elapsed time since the last file listing (when files were found) must be greater than 100ms, i.e., at least 101ms. If the rest of the code execution takes less than 2ms, one loop run is skipped. ### Modifications - Check if the time elapsed is greater than **or equal** the polling interval. - Sleep for `pollingInterval` instead of `pollingInterval - 1` milliseconds. ### Verifying this change - [x] Make sure that the change passes the CI checks. This PR adds one test for the polling interval. ### Does this pull request potentially affect one of the following parts: - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: https://github.com/pdolif/pulsar-connectors/pull/1 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
