grpc_bench icon indicating copy to clipboard operation
grpc_bench copied to clipboard

Dart: update benchmark to Dart 3.0

Open amka opened this issue 1 year ago • 11 comments

Summary of changes Changes introduced in this pull request:

  • Update Dart SDK to 3.0
  • Remove gRPC package deprecations
  • Fix Docker build stage

Reference issue to close (if applicable) Closes #146

As fart as I think Dart is required for this benchmark 'cause it's one of the "official" grpc languages I fixed the benchmark. Current version of Dart is 3.0.5 so the SDK was updated to this release. Also dependencies and the pubspec file were updated accordingly. I also renamed benchmark folder to be able to activate this benchmark. Testes locally and it worked like a charm.

Hope it help! Any commend are appreciated!

amka avatar Jul 03 '23 09:07 amka

@amka Thanks! Could you please update the CI? You can either call build.sh (or bench.sh) with the Dart suite or run ./generate_ci.sh >.github/workflows/build.yml and commit that.

LesnyRumcajs avatar Jul 03 '23 18:07 LesnyRumcajs

Sure, I will do it!

amka avatar Jul 03 '23 18:07 amka

The diff is a bit off, like the CI worker is sorting the benchmarks differently. I'll have a look later.

LesnyRumcajs avatar Jul 04 '23 09:07 LesnyRumcajs

I'm a bit pushed for time; I'll try to check this out this weekend @amka!

LesnyRumcajs avatar Jul 20 '23 08:07 LesnyRumcajs

I'm a bit pushed for time; I'll try to check this out this weekend @amka!

Oh, no worries! It's your repo! I'm just the guy who's trying to help :)

amka avatar Jul 20 '23 09:07 amka

Not sure why the script generated it for you this way, let's not bother with it. If you'd put dart after d to make CI happy it should be fine. Oh, and if you could please do these changes with git mv that'd be great, the old dart_grpc_onhold is still lingering there.

LesnyRumcajs avatar Jul 23 '23 21:07 LesnyRumcajs

Not sure why the script generated it for you this way, let's not bother with it. If you'd put dart after d to make CI happy it should be fine. Oh, and if you could please do these changes with git mv that'd be great, the old dart_grpc_onhold is still lingering there.

@LesnyRumcajs Not sure I understand you correctly about git mv. Do you mean to replace the old one _onhold with a new _bench folder?

amka avatar Sep 18 '23 14:09 amka

Not sure why the script generated it for you this way, let's not bother with it. If you'd put dart after d to make CI happy it should be fine. Oh, and if you could please do these changes with git mv that'd be great, the old dart_grpc_onhold is still lingering there.

@LesnyRumcajs Not sure I understand you correctly about git mv. Do you mean to replace the old one _onhold with a new _bench folder?

Yes, precisely. The _onhold suffix means that the particular bench suite was disabled for whatever reason. Your contribution effectively replaces it. At the current state of the PR, you can just remove it.

LesnyRumcajs avatar Sep 19 '23 06:09 LesnyRumcajs

@amka did you try running it locally recently? It seems to be failing in the CI.

LesnyRumcajs avatar Sep 19 '23 09:09 LesnyRumcajs

I've got a weird issue. When I ran sh ./bench.sh dart_grpc_bench locally for the first time it worked like a charm. When I rerun it - it fails quickly. We'll investigate it.

amka avatar Sep 19 '23 09:09 amka

@amka I fixed the meta check (whitespace issue), now the dart server is failing. I debugged it a bit, locally. The server seems to be crashing from time to time (most of the times it works just fine) during the warmup period. See the error message:

❯ docker logs dart_grpc_bench -f
Server listening on port 50051...
Unhandled exception:
Null check operator used on a null value
#0      ServerHandler.sendTrailers (package:grpc/src/server/handler.dart:384)
#1      ServerHandler._sendError (package:grpc/src/server/handler.dart:459)
#2      ServerHandler._onResponse (package:grpc/src/server/handler.dart:327)
#3      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271)
#6      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784)
#7      _StreamController._add (dart:async/stream_controller.dart:658)
#8      new Stream.fromFuture.<anonymous closure> (dart:async/stream.dart:250)
#9      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:846)
#10     Future._propagateToListeners (dart:async/future_impl.dart:875)
#11     Future._chainCoreFutureSync (dart:async/future_impl.dart:575)
#12     Future._chainCoreFutureAsync.<anonymous closure> (dart:async/future_impl.dart:613)
#13     _microtaskLoop (dart:async/schedule_microtask.dart:40)
#14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
#15     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118)
#16     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185)

It might make sense to bump the dependencies, perhaps the ones defined in pubspec.yaml and pubspec.lock are faulty?

LesnyRumcajs avatar Feb 09 '24 13:02 LesnyRumcajs