Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Except when returning early when using Fiber is an exception #353

Closed
wants to merge 3 commits into from

Conversation

pyama86
Copy link
Collaborator

@pyama86 pyama86 commented May 9, 2018

Pull-Request Check List

Nginx::Async.sleep 利用時にmrubyのreturnを実行するとLocalJumbエラーが発生する。

unexpected return (LocalJumpError)

Except when returning early when using Fiber is an exception

@matsumotory
Copy link
Owner

Thank you for your report and welcome WIP!

@pyama86
Copy link
Collaborator Author

pyama86 commented May 9, 2018

p1 = Proc.new do
  return 1
end
p1.call
# mruby/bin/mruby test.rb
trace (most recent call last):
        [0] test.rb:4
test.rb:4: unexpected return (LocalJumpError)

Proc内でreturnすると起きるので、mruby側の問題っぽいすなぁ。

@pyama86
Copy link
Collaborator Author

pyama86 commented May 10, 2018

いまだとrewrite_handlerならばsleepがうまく動くが、content_handlerなどは動かない。理由としてはfinalizeの扱いの違いがある。

finalize後に再度event loopに入る方法がないかもちょい追いかける。(AGAINしたら雑にいけないかな)

@pyama86 pyama86 force-pushed the fix-fiber-return branch 2 times, most recently from 75c0886 to 8907485 Compare May 12, 2018 05:06
@pyama86
Copy link
Collaborator Author

pyama86 commented May 12, 2018

元の実現したい要件としてはSleepを利用しつつ、リバースプロキシしたかったため、他のやり方で実装した。
#354

@pyama86 pyama86 closed this May 12, 2018
@pyama86 pyama86 deleted the fix-fiber-return branch May 12, 2018 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants