From: samuel@oriontransfer•net
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50723] [Ruby trunk Bug#595] Fiber ignores ensure clause
Date: Thu, 20 Dec 2018 04:19:21 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-75793.20181220041920.9c0aa233088d9cf4@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-595.20080924192809@ruby-lang.org
Issue #595 has been updated by ioquatix (Samuel Williams).
Target version set to next minor
After discussion, we decided that:
- Doing this in the GC is probably a bad idea.
- Ruby's general model for resource management is explicit, e.g. `f = File.open; f.close` or `File.open do |f| ... end`. The same model should apply to Fiber.
- We can implement something like `Fiber.kill` or `Fiber.close` which essentially invokes `Fiber.raise(Exception)` until the Fiber is dead.
We will test these ideas during 2.7 release. If there are any further thoughts about this approach, please feel free to add them here.
----------------------------------------
Bug #595: Fiber ignores ensure clause
https://bugs.ruby-lang.org/issues/595#change-75793
* Author: ko1 (Koichi Sasada)
* Status: Assigned
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* Target version: next minor
* ruby -v: -
* Backport:
----------------------------------------
Ruby プロセス終了時,Fiber が ensure を無視します.
これは,前から直そうと思って手がついていなかった問題です.
10月末までには直そうと思います.結構複雑なので,後回しにしていましました.
```
fib = Fiber.new{
begin
Fiber.yield :ok
ensure
puts "should be print out"
end
}
p fib.resume
```
---Files--------------------------------
ensure_fiber.patch (2.12 KB)
ensure_fiber2.patch (7.57 KB)
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2018-12-20 4:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-595.20080924192809@ruby-lang.org>
2011-06-11 5:52 ` [ruby-dev:43715] [Ruby 1.9 - Bug #595] Fiber ignores ensure clause Koichi Sasada
2011-06-11 13:14 ` [ruby-dev:43744] " Yukihiro Matsumoto
2011-06-11 13:23 ` [ruby-dev:43745] " Yui NARUSE
2011-06-26 14:24 ` [ruby-dev:43951] " Hiroshi Nakamura
2012-03-13 6:06 ` [ruby-dev:45354] [ruby-trunk - Bug #595][Assigned] " Yui NARUSE
2012-07-25 10:08 ` [ruby-dev:46005] [ruby-trunk - Bug #595] " ko1 (Koichi Sasada)
2012-07-25 13:24 ` [ruby-dev:46006] " naruse (Yui NARUSE)
2012-08-05 4:05 ` [ruby-dev:46030] " wanabe (_ wanabe)
2012-08-05 10:18 ` [ruby-dev:46031] " KOSAKI Motohiro
2012-08-20 8:56 ` [ruby-dev:46060] " SASADA Koichi
2014-01-13 10:59 ` [ruby-dev:47883] " Yura, Sokolov
2015-10-12 13:16 ` [ruby-dev:49299] [Ruby trunk " eregontp
2017-01-31 7:22 ` [ruby-dev:49967] [Ruby trunk Bug#595] " ko1
2018-11-22 0:38 ` [ruby-dev:50675] " samuel
2018-12-20 1:15 ` [ruby-dev:50722] " samuel
2018-12-20 4:19 ` samuel [this message]
2019-01-14 7:32 ` [ruby-dev:50763] " naruse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-75793.20181220041920.9c0aa233088d9cf4@ruby-lang.org \
--to=ruby-dev@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).