ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
@ 2020-02-05  9:16 shugo
  2020-02-07  5:46 ` [ruby-core:97081] " shugo
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: shugo @ 2020-02-05  9:16 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been reported by shugo (Shugo Maeda).

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608

* Author: shugo (Shugo Maeda)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:97081] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
@ 2020-02-07  5:46 ` shugo
  2020-02-07  7:37 ` [ruby-core:97083] " shugo
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: shugo @ 2020-02-07  5:46 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by shugo (Shugo Maeda).

Assignee set to shugo (Shugo Maeda)
Status changed from Open to Assigned

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-84189

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:97083] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
  2020-02-07  5:46 ` [ruby-core:97081] " shugo
@ 2020-02-07  7:37 ` shugo
  2020-05-27 23:05 ` [ruby-core:98552] " merch-redmine
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: shugo @ 2020-02-07  7:37 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by shugo (Shugo Maeda).

Assignee changed from shugo (Shugo Maeda) to nobu (Nobuyoshi Nakada)

nobu (Nobuyoshi Nakada) wrote in #note-2:
> How about https://github.com/ruby/ruby/pull/2884

ko1 suggested Mutex#release (new version of Mutex#sleep) for backward compatibility.
What do you think of it?


----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-84191

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:98552] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
  2020-02-07  5:46 ` [ruby-core:97081] " shugo
  2020-02-07  7:37 ` [ruby-core:97083] " shugo
@ 2020-05-27 23:05 ` merch-redmine
  2021-03-10 19:37 ` [ruby-core:102813] " merch-redmine
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: merch-redmine @ 2020-05-27 23:05 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).


I agree with @Eregon that we can probably change the return value of ConditionVariable#wait in Ruby 3.  As it always returns true currently, it's worthless and nothing should be relying on it.

I can see that changing `Mutex#sleep` to start returning `nil` could break things, though.  I think we do need a new method.  Maybe `Mutex#sleep_for` or `Mutex#sleep!`.

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-85845

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:102813] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (2 preceding siblings ...)
  2020-05-27 23:05 ` [ruby-core:98552] " merch-redmine
@ 2021-03-10 19:37 ` merch-redmine
  2021-03-18  0:06 ` [ruby-core:102910] " merch-redmine
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: merch-redmine @ 2021-03-10 19:37 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).


I've added a pull request that builds on @nobu's pull request, but uses a new method (`Mutex#sleep_for`) instead of making backwards-incompatible changes to `Mutex#sleep`: https://github.com/ruby/ruby/pull/4256

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-90865

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:102910] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (3 preceding siblings ...)
  2021-03-10 19:37 ` [ruby-core:102813] " merch-redmine
@ 2021-03-18  0:06 ` merch-redmine
  2021-03-18 14:38 ` [ruby-core:102917] " eregontp
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: merch-redmine @ 2021-03-18  0:06 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).


@matz agreed to change the return value of Mutex#sleep at the last developer meeting.  However, that breaks a Mutex_m test: https://github.com/ruby/ruby/pull/4256/checks?check_run_id=2135513377#step:15:1295

So the Mutex_m test needs to be fixed first, a new release needs to be made, and the bundled gems need to be updated, before the Mutex#sleep change can be merged.

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-90974

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:102917] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (4 preceding siblings ...)
  2021-03-18  0:06 ` [ruby-core:102910] " merch-redmine
@ 2021-03-18 14:38 ` eregontp
  2021-04-16  8:51 ` [ruby-core:103479] " ko1
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: eregontp @ 2021-03-18 14:38 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by Eregon (Benoit Daloze).


That looks like an error of `rbs` actually, cc @soutaro

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-90982

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:103479] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (5 preceding siblings ...)
  2021-03-18 14:38 ` [ruby-core:102917] " eregontp
@ 2021-04-16  8:51 ` ko1
  2021-06-16 16:46 ` [ruby-core:104312] " merch-redmine
  2021-06-24 19:24 ` [ruby-core:104396] " merch-redmine
  8 siblings, 0 replies; 10+ messages in thread
From: ko1 @ 2021-04-16  8:51 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by ko1 (Koichi Sasada).


Previous dev-meeting (March), there is no objection to change the return value of `Mutex#sleep`.

> matz: agreed to change the return value of Mutex#sleep.
> naruse: agreed to change in Ruby 3.1 because this is so detail

Congrats!

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-91579

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:104312] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (6 preceding siblings ...)
  2021-04-16  8:51 ` [ruby-core:103479] " ko1
@ 2021-06-16 16:46 ` merch-redmine
  2021-06-24 19:24 ` [ruby-core:104396] " merch-redmine
  8 siblings, 0 replies; 10+ messages in thread
From: merch-redmine @ 2021-06-16 16:46 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).

Assignee changed from nobu (Nobuyoshi Nakada) to soutaro (Soutaro Matsumoto)

I submitted a pull request to rbs to fix the failure (https://github.com/ruby/rbs/pull/683) I also updated the ruby pull request (https://github.com/ruby/ruby/pull/4256) to rebase it on the current master branch. Once the rbs pull request is merged and a release is made, we should be able to merge the ruby pull request.

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-92535

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: soutaro (Soutaro Matsumoto)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:104396] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
  2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
                   ` (7 preceding siblings ...)
  2021-06-16 16:46 ` [ruby-core:104312] " merch-redmine
@ 2021-06-24 19:24 ` merch-redmine
  8 siblings, 0 replies; 10+ messages in thread
From: merch-redmine @ 2021-06-24 19:24 UTC (permalink / raw)
  To: ruby-core

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).


The rbs pull request has been merged.  So we just need to wait for the next rbs gem release and for bundled gems to be updated, then we can merge the pull request.

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-92637

* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: soutaro (Soutaro Matsumoto)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later.

```
require "monitor"
m = Monitor.new
c = m.new_cond
m.synchronize { p c.wait(0.1) }
```

However, it's not critical because most programs check the condition after wait.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-24 19:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
2020-02-07  5:46 ` [ruby-core:97081] " shugo
2020-02-07  7:37 ` [ruby-core:97083] " shugo
2020-05-27 23:05 ` [ruby-core:98552] " merch-redmine
2021-03-10 19:37 ` [ruby-core:102813] " merch-redmine
2021-03-18  0:06 ` [ruby-core:102910] " merch-redmine
2021-03-18 14:38 ` [ruby-core:102917] " eregontp
2021-04-16  8:51 ` [ruby-core:103479] " ko1
2021-06-16 16:46 ` [ruby-core:104312] " merch-redmine
2021-06-24 19:24 ` [ruby-core:104396] " merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).