From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS24940 94.130.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id EFFAC1F642 for ; Tue, 31 Jan 2023 17:02:33 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=Sf+T3Se7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=BGS1hE33; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 9684F7F071; Tue, 31 Jan 2023 17:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1675184546; bh=AUi9mn3wyxtNFufQP6Wi3rpbzdttr4HcoCKqpgVTNM0=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=Sf+T3Se7qknuoir3TTAxWt6GE1aM1JPgvbYSPZjILs1qgdMHOppVEAwkuHtmxGCmY uaKjICqpEsIwCcugkUApNaLDfdirHb33uhj75HZQ+Y1etmvEzvf19e2Bql2X54237Z xo8q6YdEBidd7cuY88CNwy8yuP5ypAt2uaMwujAo= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id B1E8B7F064 for ; Tue, 31 Jan 2023 17:02:22 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=BGS1hE33; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=5baXG6i+O+TY4KqsipSd3aof6gTz7RCsr+w6P1bgLDw=; b=BGS1hE33xfQFHIsThtp/D1QHOox4eNeS4aQrpttq3IIgjF/aSgWjzKL1QLaN/e5r3fne +w8SJwMlNH7O+NXC3VwgANkmeU8M6ehzUJgoiYrsPawhkHrWnYMqCkyUi45jeP0yq4Ji5E olunZrGKZw0SEc3Hkj5u7tiQniX1EiBFGNZfeO/qiDHSM2wdU/xSIfoxHLCjdXVuUDQmls aIt9vdViwNsdG4ZakhawH/jvp9NxrZ2KZBA5+fSh0GyyetUxQLSIcgWnmQVN6ugOQmPv/X CLFjJoCnVdgkqU/TXNwTZ1FcXxfOco8ulQdgWgnzWYch3uLHxcSC4H0bdEk1bhrg== Received: by filterdrecv-6c4ccfbdd8-br42k with SMTP id filterdrecv-6c4ccfbdd8-br42k-1-63D9499C-8B 2023-01-31 17:02:20.743412668 +0000 UTC m=+6458206.279801810 Received: from herokuapp.com (unknown) by geopod-ismtpd-canary-0 (SG) with ESMTP id ogA88VJETD2WfnkTZIBZoA for ; Tue, 31 Jan 2023 17:02:20.513 +0000 (UTC) Date: Tue, 31 Jan 2023 17:02:20 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 19154 X-Redmine-Issue-Author: fxn X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: fxn X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 88534 X-SG-EID: =?us-ascii?Q?Gg3oD6sm+uO8=2F=2FvPD7Pc20vmQucbh=2FeP016RLAVuAgDK55zIMbGfsoPmorYbIK?= =?us-ascii?Q?jYLtCmLTmdzpQBRFQU65Qda6NA6kmL04q9wdLUu?= =?us-ascii?Q?Y4bUHRIbZ1G=2FmQ0qaS3CXfN5XN3q2DNeXpdF+FP?= =?us-ascii?Q?HBCglFDd8dEHxb89+U6k4vI2H8qJkFOe9RoaDwl?= =?us-ascii?Q?d7ezpFF6w6emK0=2FvPmer7EQipSHcqWCnXEFyL8t?= =?us-ascii?Q?qDTJc8c4dBuIn5BmI=2FE8fMN=2FoHqIlPTPqGsMzMZ?= =?us-ascii?Q?j3D5NYhGD6FMsgyRnHt9g=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 3P4AFF7MJDKD3J55CAFNKG5JUABHCRCK X-Message-ID-Hash: 3P4AFF7MJDKD3J55CAFNKG5JUABHCRCK X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:112145] [Ruby master Bug#19154] Specify require and autoload guarantees in ractors List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "fxn (Xavier Noria) via ruby-core" Cc: "fxn (Xavier Noria)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19154 has been updated by fxn (Xavier Noria). > I imagine it's a bit of a pain to have to eager autoload everything before you start a Ractor, but if that's what needs to be done then c'est la vie. This is a delicate point, in my view, because you cannot eager load what you do not control. And you do not control when your Ractor needs to invoke 3rd party APIs. ---------------------------------------- Bug #19154: Specify require and autoload guarantees in ractors https://bugs.ruby-lang.org/issues/19154#change-101581 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.2.0preview3 (2022-11-27) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Given a file `c.rb`: ```ruby class C end ``` the following script: ```ruby r1 = Ractor.new do require './c.rb' end r2 = Ractor.new do require './c.rb' end r1.take r2.take ``` raises: ``` % ruby -v foo.rb ruby 3.2.0preview3 (2022-11-27) [x86_64-darwin22] foo.rb:1: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues. # terminated with exception (report_on_exception is true): # terminated with exception (report_on_exception is true): :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from foo.rb:6:in `block in
' :37:in `require':164:in `ensure in require': : can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' from foo.rb:6:in `block in
' :698:in `take': thrown by remote Ractor. (Ractor::RemoteError) from foo.rb:9:in `
' :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from foo.rb:2:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' ``` Would it be possible to have documentation about their interaction? This is important also to understand autoloading within ractors, since constant references may trigger `require` calls. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/