Github user dmcguire81 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5559#discussion_r28618212
  
    --- Diff: 
streaming/src/test/scala/org/apache/spark/streaming/ReceiverSuite.scala ---
    @@ -176,7 +176,7 @@ class ReceiverSuite extends TestSuiteBase with Timeouts 
with Serializable {
           blockGenerator.addData(count)
           generatedData += count
           count += 1
    -      Thread.sleep(1)
    +      Thread.sleep(0)
    --- End diff --
    
    It's not clear that this is a no-op (because of system time granularity - 
see discussion 
[here](http://stackoverflow.com/questions/1600572/are-thread-sleep0-and-thread-yield-statements-equivalent));
 however, this can't sleep for 1ms because the rate specified is *greater* than 
1000 messages / second (1 message / ms), so the test would not actually trigger 
the throttling. It seems intuitive to replace this with Thread.yield(), since 
it's presumably necessary for a background thread to get a chance to process 
receiving messages, but performing that refactoring does not succeed, nor does 
simply removing the statement.
    
    Any suggestions? Am I understanding the threading model correctly?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to