There might be a misunderstanding on my part, or something missing. Please point out any discrepancies or omissions.
After looking into it, it appears that the error is occurring because mrb_gc_register is executed on every sleep operation. If mrb_gc_register is run at the start of the fiber and mrb_gc_unregister is run at the end of the fiber, the error will no longer occur.
I tried creating a PR. Please check it.
Pull-Request Check List
[ ] Add patches into src/.
[ ] Add test into test/. Please see about test docs.
Hello!!
@matsumotory Please review.
When repeatedly performing Nginx::Async.sleep, it overflows the value of MRB_ARY_LENGTH_MAX, resulting in the following error.
https://github.com/matsumotory/ngx_mruby/blob/af4228888587680d2c44b0aebbfb91e6e470d219/mruby/src/array.c#L26-L29
The issue also occurs with ngx_mruby v2.5.0.
There might be a misunderstanding on my part, or something missing. Please point out any discrepancies or omissions.
After looking into it, it appears that the error is occurring because mrb_gc_register is executed on every sleep operation. If mrb_gc_register is run at the start of the fiber and mrb_gc_unregister is run at the end of the fiber, the error will no longer occur.
I tried creating a PR. Please check it.
Pull-Request Check List
src/
.test/
. Please see about test docs.docs/
if you change the features such as build system, Ruby methods, class and nginx directives.