mobile: Replace std::thread with Envoy::Thread::PosixThread#32610
mobile: Replace std::thread with Envoy::Thread::PosixThread#32610abeyad merged 15 commits intoenvoyproxy:mainfrom
Conversation
2c7068d to
4e56de8
Compare
|
/retest |
|
/assign @abeyad @alyssawilk |
...test/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator_test.cc
Outdated
Show resolved
Hide resolved
|
adding @danzh2010 since she wrote the original code (I think), in case she has any concerns |
...le/library/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator.h
Outdated
Show resolved
Hide resolved
Can you elaborate it? Envoy::Thread::Thread is just an interface and I assume PosixThread is an implementation of it. |
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
|
This PR is ready for another review. PTAL. |
...e/library/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator.cc
Outdated
Show resolved
Hide resolved
...le/library/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator.h
Show resolved
Hide resolved
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
|
/retest |
alyssawilk
left a comment
There was a problem hiding this comment.
Two thoughts for now - mostly trusting Ali on E-M changes
/wait
Signed-off-by: Fredy Wijaya <fredyw@google.com>
...le/library/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator.h
Show resolved
Hide resolved
Signed-off-by: Fredy Wijaya <fredyw@google.com>
Signed-off-by: Fredy Wijaya <fredyw@google.com>
|
no relevant owners for "mobile" |
|
added @lizan for cross company review |
Actually, per the new policy, this doesn't need cross company review: https://github.com/envoyproxy/envoy/pull/30995/files So I'm merging |
* origin: (34 commits) update CODEOWNER (envoyproxy#32457) Delete unused runtime flag. (envoyproxy#32739) mobile: Use direct ByteBuffer to pass data between C++ and Java (envoyproxy#32715) quic: support cert selection by SNI, non-PEM formats (envoyproxy#32260) mobile: Replace std::thread with Envoy::Thread::PosixThread (envoyproxy#32610) grpc: Add support for max frame length in gPRC frame decoding (envoyproxy#32511) build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (envoyproxy#32728) build(deps): bump the examples-golang-network group in /examples/golang-network/simple with 1 update (envoyproxy#32732) build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /contrib/golang/filters/http/test/test_data/property (envoyproxy#32731) build(deps): bump otel/opentelemetry-collector from `246dfe9` to `71ac13c` in /examples/opentelemetry (envoyproxy#32730) build(deps): bump the examples-grpc-bridge group in /examples/grpc-bridge/server with 2 updates (envoyproxy#32720) build(deps): bump the contrib-golang group in /contrib/golang/router/cluster_specifier/test/test_data/simple with 1 update (envoyproxy#32721) build(deps): bump the contrib-golang group in /contrib/golang/filters/http/test/test_data/echo with 1 update (envoyproxy#32722) build(deps): bump the examples-ext-authz group in /examples/ext_authz/auth/grpc-service with 1 update (envoyproxy#32723) build(deps): bump the contrib-golang group in /contrib/golang/filters/http/test/test_data/routeconfig with 1 update (envoyproxy#32724) build(deps): bump the examples-load-reporting group in /examples/load-reporting-service with 1 update (envoyproxy#32726) build(deps): bump the contrib-golang group in /contrib/golang/filters/http/test/test_data/buffer with 1 update (envoyproxy#32727) build(deps): bump the examples-golang-http group in /examples/golang-http/simple with 1 update (envoyproxy#32729) opentelemetrytracer: Add User-Agent header to OTLP trace exporters (envoyproxy#32659) build: remove incorrect cc_library after tls code move (envoyproxy#32714) ...
This PR replaces the use of
std::threadwithEnvoy::Thread::PosixThread(backed bypthread). The reason for this change is becausestd::threadmay throw an exception and when exceptions are disabled, it will crash the program. For some certain code, such as the cert validation, it should not crash the program when a thread cannot be created, but it should return an error instead.This PR also refactors the POSIX thread wrapper implementation and exposes the APIs via
Envoy::Thread::PosixThreadFactoryandEnvoy::Thread::PosixThreadso that they can be used directly by Envoy Mobile since Envoy Mobile only supports Android and iOS and those OSes support POSIX. TheEnvoy::Thread::PosixThreadhas additional functions not available inEnvoy::Thread::Thread, such aspthreadId()andjoinable()to make the migration fromstd::threadtoEnvoy::Thread::PosixThreadeasier. TheEnvoy::PosixThread::pthreadId()is especially useful for doing a comparison withEnvoy::PosixThreadFactory::currentPthreadId().Risk Level: medium
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: mobile