mercari / grpc-federation

gRPC Federation generates a gRPC server by writing a custom option in Protocol Buffers
MIT License
318 stars 13 forks source link

Fix cleanup process for plugin #207

Closed goccy closed 4 months ago

goccy commented 4 months ago

If an error has already been returned from instanceModErrCh, calling write() will hang. Therefore, if an error is returned even once, the closed flag will be set to true, and any subsequent write() calls will immediately return.

https://github.com/mercari/grpc-federation/compare/fix-plugin?expand=1#diff-3b3c6f33ba272faf69f2b02309c3198a65dd408af919c76064348877a20e2961R209-R211

Also, since performing the plugin initialization process in every NewLocalValue caused performance issues, it will be restricted to cases where the context library is used.

Finally, I improved the process of creating the enum list.

github-actions[bot] commented 4 months ago

Code Metrics Report

main (5268f6c) #207 (3c580e6) +/-
Coverage 65.0% 65.0% +0.0%
Code to Test Ratio 1:0.3 1:0.3 -0.0
Test Execution Time 7m3s 7m9s +6s
Details ``` diff | | main (5268f6c) | #207 (3c580e6) | +/- | |---------------------|----------------|----------------|-------| + | Coverage | 65.0% | 65.0% | +0.0% | | Files | 69 | 69 | 0 | | Lines | 11475 | 11574 | +99 | + | Covered | 7457 | 7522 | +65 | - | Code to Test Ratio | 1:0.3 | 1:0.3 | -0.0 | | Code | 36583 | 36758 | +175 | | Test | 12567 | 12567 | 0 | - | Test Execution Time | 7m3s | 7m9s | +6s | ```

Code coverage of files in pull request scope (71.2% → 71.0%)

Files Coverage +/-
generator/code_generator.go 79.6% -0.0%
grpc/federation/cel.go 0.0% 0.0%
grpc/federation/cel/plugin.go 0.0% 0.0%
resolver/def.go 87.0% -7.1%
resolver/message.go 75.3% -0.0%
resolver/resolver.go 81.1% +0.1%
resolver/value.go 77.8% -1.0%

Reported by octocov