You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "HarshMehta112 (via GitHub)" <gi...@apache.org> on 2026/07/07 05:59:50 UTC
[PR] fix(script-router): clear all script globals on runtime pool return [dubbo-go]
HarshMehta112 opened a new pull request, #3477:
URL: https://github.com/apache/dubbo-go/pull/3477
Fixes #3453
### Description
#### 5. Script-router JS runtime no longer leaks cross-request state
`cluster/router/script/instance/js_instance.go`
Pooled `goja.Runtime` instances were never returned to the pool, and request/script globals
survived reuse. Added `defer reset()+Put()` in `Run()`. `reset()` snapshots the built-in
global keys at construction and deletes every global outside that set — clearing both request
bindings and user-script-defined globals while preserving built-ins.
### Tests
- `TestJsInstanceResetClearsBindings` (incl. user-defined global), `TestJsInstanceRunReturnsRuntimeToPool`
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature works
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(script-router): clear all script globals on runtime pool return [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3477:
URL: https://github.com/apache/dubbo-go/pull/3477#issuecomment-4900647931
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3477) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3477&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3477&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3477&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3477&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3477&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3477)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(script-router): clear all script globals on runtime pool return [dubbo-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3477:
URL: https://github.com/apache/dubbo-go/pull/3477#issuecomment-4900688758
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3477?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `75.00000%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 54.08%. Comparing base ([`8b5bbcf`](https://app.codecov.io/gh/apache/dubbo-go/commit/8b5bbcf192aaac782e2fcf1ea2a6c7c90d9e3e1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`55e0947`](https://app.codecov.io/gh/apache/dubbo-go/commit/55e0947cf7e8d07d2b15a8990b3343ee6653693a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3477?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [cluster/router/script/instance/js\_instance.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3477?src=pr&el=tree&filepath=cluster%2Frouter%2Fscript%2Finstance%2Fjs_instance.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2x1c3Rlci9yb3V0ZXIvc2NyaXB0L2luc3RhbmNlL2pzX2luc3RhbmNlLmdv) | 75.00% | [2 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3477?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #3477 +/- ##
===========================================
+ Coverage 53.57% 54.08% +0.51%
===========================================
Files 460 461 +1
Lines 35182 35491 +309
===========================================
+ Hits 18847 19194 +347
+ Misses 14857 14777 -80
- Partials 1478 1520 +42
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3477?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(script-router): clear all script globals on runtime pool return [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed pull request #3477: fix(script-router): clear all script globals on runtime pool return
URL: https://github.com/apache/dubbo-go/pull/3477
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org