Merge branch 'master' into cpp_races

pull/5099/head
Vijay Pai 9 years ago
commit 5014341da6
  1. 4
      examples/node/greeter_client.js
  2. 4
      examples/node/greeter_server.js
  3. 7
      examples/node/package.json
  4. 4
      examples/node/route_guide/route_guide_client.js
  5. 4
      examples/node/route_guide/route_guide_server.js
  6. 11
      src/core/iomgr/tcp_server.h
  7. 12
      src/core/support/stack_lockfree.c
  8. 2
      src/csharp/Grpc.Core/Internal/NativeExtension.cs
  9. 6
      test/distrib/node/run_distrib_test.sh
  10. 3
      tools/run_tests/distribtest_targets.py

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto';
var grpc = require('../../');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
function main() {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto';
var grpc = require('../../');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
/**

@ -0,0 +1,7 @@
{
"name": "grpc-examples",
"version": "0.1.0",
"dependencies": {
"grpc": "0.12.0"
}
}

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -36,7 +36,7 @@ var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var grpc = require('../../../');
var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var client = new routeguide.RouteGuide('localhost:50051',
grpc.Credentials.createInsecure());

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,7 +35,7 @@ var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var grpc = require('../../../');
var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var COORD_FACTOR = 1e7;

@ -40,15 +40,14 @@
/* Forward decl of grpc_tcp_server */
typedef struct grpc_tcp_server grpc_tcp_server;
typedef struct grpc_tcp_server_acceptor grpc_tcp_server_acceptor;
struct grpc_tcp_server_acceptor {
typedef struct grpc_tcp_server_acceptor {
/* grpc_tcp_server_cb functions share a ref on from_server that is valid
until the function returns. */
grpc_tcp_server *from_server;
/* Indices that may be passed to grpc_tcp_server_port_fd(). */
unsigned port_index;
unsigned fd_index;
};
} grpc_tcp_server_acceptor;
/* Called for newly connected TCP connections. */
typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg,
@ -57,7 +56,7 @@ typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg,
/* Create a server, initially not bound to any ports. The caller owns one ref.
If shutdown_complete is not NULL, it will be used by
grpc_tcp_server_unref(). */
grpc_tcp_server_unref() when the ref count reaches zero. */
grpc_tcp_server *grpc_tcp_server_create(grpc_closure *shutdown_complete);
/* Start listening to bound ports */
@ -84,7 +83,7 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, unsigned port_index);
/* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth
(port_index) call to add_port() on this server, or -1 if the indices are out
of bounds. The file descriptor remains owned by the server, and will be
cleaned up when grpc_tcp_server_destroy is called. */
cleaned up when the ref count reaches zero. */
int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
unsigned fd_index);
@ -97,7 +96,7 @@ grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s);
void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
grpc_closure *shutdown_starting);
/* If the recount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue
/* If the refcount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue
a call (exec_ctx!=NULL) to shutdown_complete. */
void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -99,6 +99,11 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) {
/* Point the head at reserved dummy entry */
stack->head.contents.index = INVALID_ENTRY_INDEX;
/* Fill in the pad and aba_ctr to avoid confusing memcheck tools */
#ifdef GPR_ARCH_64
stack->head.contents.pad = 0;
#endif
stack->head.contents.aba_ctr = 0;
return stack;
}
@ -115,6 +120,11 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
/* First fill in the entry's index and aba ctr for new head */
newhead.contents.index = (uint16_t)entry;
#ifdef GPR_ARCH_64
/* Fill in the pad to avoid confusing memcheck tools */
newhead.contents.pad = 0;
#endif
/* Also post-increment the aba_ctr */
curent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm);
newhead.contents.aba_ctr = ++curent.contents.aba_ctr;

@ -106,7 +106,7 @@ namespace Grpc.Core.Internal
private static string GetExecutingAssemblyDirectory()
{
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
return Path.GetDirectoryName(typeof(NativeExtension).GetTypeInfo().Assembly.Location);
}
private static string GetPlatformString()

@ -36,17 +36,17 @@ nvm install $1
npm install -g node-static
STATIC_SERVER=localhost
STATIC_SERVER=127.0.0.1
STATIC_PORT=8080
# Serves the input_artifacts directory statically at localhost:8080
static "$EXTERNAL_GIT_ROOT/input_artifacts" -a STATIC_SERVER -p STATIC_PORT &
static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT &
STATIC_PID=$!
STATIC_URL="http://$STATIC_SERVER:$STATIC_PORT/"
npm install --unsafe-perm $STATIC_URL/grpc.tgz --grpc_node_binary_host_mirror=$STATIC_URL
kill $STATIC_PID
kill -9 $STATIC_PID
./distrib_test.js

@ -104,7 +104,8 @@ class NodeDistribTest(object):
'tools/dockerfile/distribtest/node_%s_%s' % (
self.docker_suffix,
self.arch),
'test/distrib/node/run_distrib_test.sh %s' % (
# bash -l needed to make nvm available
'bash -l test/distrib/node/run_distrib_test.sh %s' % (
self.node_version))
def __str__(self):
return self.name

Loading…
Cancel
Save