You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/11/04 22:59:11 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #8586: ARROW-10491: [FlightRPC][Java] Fix NPE when using makeContext

lidavidm commented on a change in pull request #8586:
URL: https://github.com/apache/arrow/pull/8586#discussion_r517681068



##########
File path: java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/RequestContextAdapter.java
##########
@@ -30,7 +30,7 @@
  */
 public class RequestContextAdapter implements RequestContext {
   public static final Context.Key<RequestContext> REQUEST_CONTEXT_KEY =
-          Context.key("arrow-flight-request-context");
+          Context.keyWithDefault("arrow-flight-request-context", new RequestContextAdapter());

Review comment:
       Sorry - now that I think about this again, this is shared mutable state, so wouldn't it be possible (though unlikely) for different calls to persist data into this instance of RequestContextAdapter? It might be better to leave this nullable and check usages of it instead.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org