You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "shubhamvishu (via GitHub)" <gi...@apache.org> on 2024/01/09 11:05:25 UTC
[PR] Forebidden Thread.sleep API [lucene]
shubhamvishu opened a new pull request, #13001:
URL: https://github.com/apache/lucene/pull/13001
### Description
This API mark `Thread.sleep` API as forebidden for futures uses in the codebase and suppresses the existing usages.
Closes #12946
<!--
If this is your first contribution to Lucene, please make sure you have reviewed the contribution guide.
https://github.com/apache/lucene/blob/main/CONTRIBUTING.md
-->
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1907129375
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on code in PR #13001:
URL: https://github.com/apache/lucene/pull/13001#discussion_r1446135710
##########
gradle/validation/forbidden-apis/defaults.all.txt:
##########
@@ -74,3 +74,8 @@ javax.sql.rowset.spi.SyncFactory
@defaultMessage Math.fma is insanely slow (2500x) in many environments (e.g. VMs). Use multiply/add and suffer the extra rounding
java.lang.Math#fma(float,float,float)
java.lang.Math#fma(double,double,double)
+
+@defaultMessage We should not use Thread.sleep in lucene code
+java.lang.Thread#sleep(long)
Review Comment:
you should also move the message into the signature. I'd also prefer a more meaningful message.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "shubhamvishu (via GitHub)" <gi...@apache.org>.
shubhamvishu commented on code in PR #13001:
URL: https://github.com/apache/lucene/pull/13001#discussion_r1446269754
##########
gradle/validation/forbidden-apis/defaults.all.txt:
##########
@@ -74,3 +74,8 @@ javax.sql.rowset.spi.SyncFactory
@defaultMessage Math.fma is insanely slow (2500x) in many environments (e.g. VMs). Use multiply/add and suffer the extra rounding
java.lang.Math#fma(float,float,float)
java.lang.Math#fma(double,double,double)
+
+@defaultMessage We should not use Thread.sleep in lucene code
+java.lang.Thread#sleep(long)
Review Comment:
Makes sense. I addressed these in the new revision
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1927410583
I moved the changes entry to Lucene 10.0, as to me it makes no sense to apply this to Lucene 9.x which is not used for active development. New code enters main first and I had trouble in merging this (and 9.x has many more sleeps).
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1883368845
P.S.: You don't need to force-push, it is better to keep track what was changed in a PR. The PR will get squashed anyways.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "shubhamvishu (via GitHub)" <gi...@apache.org>.
shubhamvishu commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1883422583
> In general this looks fine, although I think we should also work on remove some of those sleeps. For all others there should be an explanation, why the test needs sleeping.
+1 to remove some to these usages. I didn't pursue since there are just too many of them. I think we could scope this PR to only add the api to forbidden ones and suppress all the usages and then follow up with a second pass or PR to remove those usages as much as possible. If that sounds good I could create a separate issue to reduce the existing usages(or we could use the same issue too). Let me know what do you think?
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on code in PR #13001:
URL: https://github.com/apache/lucene/pull/13001#discussion_r1446133887
##########
gradle/validation/forbidden-apis/defaults.all.txt:
##########
@@ -74,3 +74,8 @@ javax.sql.rowset.spi.SyncFactory
@defaultMessage Math.fma is insanely slow (2500x) in many environments (e.g. VMs). Use multiply/add and suffer the extra rounding
java.lang.Math#fma(float,float,float)
java.lang.Math#fma(double,double,double)
+
+@defaultMessage We should not use Thread.sleep in lucene code
+java.lang.Thread#sleep(long)
Review Comment:
I'd use `java.lang.Thread#sleep(**)`.
This prevents any sleep variant coming soon. E.g., the Duration one not yet available in JDK 17.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "shubhamvishu (via GitHub)" <gi...@apache.org>.
shubhamvishu commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1907646476
@uschindler @mikemccand I think we could merge this now unless I'm missing something?
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler merged PR #13001:
URL: https://github.com/apache/lucene/pull/13001
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forebidden Thread.sleep API [lucene]
Posted by "shubhamvishu (via GitHub)" <gi...@apache.org>.
shubhamvishu commented on code in PR #13001:
URL: https://github.com/apache/lucene/pull/13001#discussion_r1446269754
##########
gradle/validation/forbidden-apis/defaults.all.txt:
##########
@@ -74,3 +74,8 @@ javax.sql.rowset.spi.SyncFactory
@defaultMessage Math.fma is insanely slow (2500x) in many environments (e.g. VMs). Use multiply/add and suffer the extra rounding
java.lang.Math#fma(float,float,float)
java.lang.Math#fma(double,double,double)
+
+@defaultMessage We should not use Thread.sleep in lucene code
+java.lang.Thread#sleep(long)
Review Comment:
Makes sense. I updated these in the new revision
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1883719867
+1 to merge this, first, so we stop the bleeding (no more `Thread.sleep` added to the code base), and in follow-on PR we can start whittling down the existing grandfather'd `Thread.sleep` calls.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Forbidden Thread.sleep API [lucene]
Posted by "shubhamvishu (via GitHub)" <gi...@apache.org>.
shubhamvishu commented on PR #13001:
URL: https://github.com/apache/lucene/pull/13001#issuecomment-1927343001
@uschindler I have removed the added file. Thanks!
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org