anishshri-db opened a new pull request, #36620:
URL: https://github.com/apache/spark/pull/36620
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
Fix awaitOffset to wait for committedOffset to reach atleast expected offset
instead of exact value for long offsets. Also fixed the RateStreamProvider test
to use only row values for requested range. Basically, for numeric increasing
offsets, we could have called awaitOffset after the stream has moved past the
expected newOffset or if committedOffsets changed after notify. In this case,
its safe to exit, since at-least the given Offset has been reached and the
equality condition might never be met.
### Why are the changes needed?
Fixing bug with awaitOffset logic and RateStreamProvider test
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
With the current code, we were seeing race conditions where the test would
hang and get terminated after a 60 min timeout. With the change, ran the
specific test 100 times multiple times and verified that we don't see the test
failure any more. Was also able to simulate the failure by introducing
arbitrary sleep in the code paths and ensured that the test passes with the
above fix.
```
[info] RateStreamProviderSuite:
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for avro / Test / testOnly
11:08:40.357 WARN org.apache.hadoop.util.NativeCodeLoader: Unable to load
native-hadoop library for your platform... using builtin-java classes where
applicable
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for hive / Test / testOnly
[info] - RateStreamProvider in registry (531 milliseconds)
[info] - compatible with old path in registry (3 milliseconds)
[warn] multiple main classes detected: run 'show discoveredMainClasses' to
see the list
11:08:43.608 WARN
org.apache.spark.sql.execution.streaming.ResolveWriteToStream:
spark.sql.adaptive.enabled is not supported in streaming DataFrames/Datasets
and will be disabled.
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for mllib / Test / testOnly
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for sql-kafka-0-10 / Test / testOnly
[info] - microbatch - basic (3 seconds, 966 milliseconds)
11:08:45.807 WARN
org.apache.spark.sql.execution.streaming.ResolveWriteToStream:
spark.sql.adaptive.enabled is not supported in streaming DataFrames/Datasets
and will be disabled.
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for repl / Test / testOnly
11:08:48.493 WARN
org.apache.spark.sql.execution.streaming.ResolveWriteToStream:
spark.sql.adaptive.enabled is not supported in streaming DataFrames/Datasets
and will be disabled.
[warn] multiple main classes detected: run 'show discoveredMainClasses' to
see the list
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for examples / Test / testOnly
[info] - microbatch - restart (4 seconds, 365 milliseconds)
11:08:50.278 WARN
org.apache.spark.sql.execution.streaming.ResolveWriteToStream:
spark.sql.adaptive.enabled is not supported in streaming DataFrames/Datasets
and will be disabled.
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for assembly / Test / testOnly
[info] - microbatch - uniform distribution of event timestamps (696
milliseconds)
[info] - microbatch - infer offsets (98 milliseconds)
[info] - microbatch - predetermined batch size (86 milliseconds)
[info] - microbatch - data read (85 milliseconds)
[info] - valueAtSecond (0 milliseconds)
[info] - overflow (265 milliseconds)
[info] - illegal option values (4 milliseconds)
[info] - user-specified schema given (9 milliseconds)
[info] - continuous data (1 second, 6 milliseconds)
11:08:55.295 WARN
org.apache.spark.sql.execution.streaming.sources.RateStreamProviderSuite:
===== POSSIBLE THREAD LEAK IN SUITE
o.a.s.sql.execution.streaming.sources.RateStreamProviderSuite, threads:
rpc-boss-3-1 (daemon=true), shuffle-boss-6-1 (daemon=true),
state-store-maintenance-task (daemon=true) =====
[info] Run completed in 17 seconds, 887 milliseconds.
[info] Total number of tests run: 15
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 15, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
18:59:59) INFO: Current date is 2022-05-19
(18:59:59) INFO: Analyzed target
//sql/core:org.apache.spark.sql.execution.streaming.sources.RateStreamProviderSuite-hive-2.3__hadoop-3.2
(0 packages loaded, 0 targets configured).
(18:59:59) INFO: Found 1 test target...
Target
//sql/core:org.apache.spark.sql.execution.streaming.sources.RateStreamProviderSuite-hive-2.3__hadoop-3.2
up-to-date:
bazel-bin/sql/core/org.apache.spark.sql.execution.streaming.sources.RateStreamProviderSuite-hive-2.3__hadoop-3.2
(19:09:58) INFO: Elapsed time: 599.874s, Critical Path: 124.19s
(19:09:58) INFO: 101 processes: 1 internal, 100 linux-sandbox.
//sql/core:org.apache.spark.sql.execution.streaming.sources.RateStreamProviderSuite-hive-2.3__hadoop-3.2
PASSED in 23.7s
Stats over 100 runs: max = 23.7s, min = 17.5s, avg = 19.7s, dev = 1.5s
Executed 1 out of 1 test: 1 test passes.
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]