Skip to content

Instantly share code, notes, and snippets.

View misterdjules's full-sized avatar

Julien Gilli misterdjules

View GitHub Profile
@misterdjules
misterdjules / curl-shell.txt
Last active March 6, 2021 17:22
monitoring active libuv handles with node.js
$ curl localhost:8080/ &
[1] 70338
$ curl localhost:8080/ &
[2] 70347
$ curl localhost:8080/ &
[3] 70356
$ curl localhost:8080/ &
[4] 70365
$ curl localhost:8080/ &
[5] 70374
nfml-jgilliXAH:find-my-way jgilli$ node --prof-process isolate-0x103802400-v8.log
Code move event for unknown code: 0x30fac5d4de20
Code move event for unknown code: 0x30fac5d5d2f8
Statistical profiling result from isolate-0x103802400-v8.log, (61379 ticks, 1220 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
1916 3.1% /usr/lib/system/libsystem_platform.dylib
321 0.5% /usr/lib/system/libsystem_pthread.dylib
211 0.3% /usr/lib/system/libsystem_malloc.dylib

Challenges in using post-mortem debugging with async/await

Introduction

async/await is a new feature of the EcmaScript programming language that combines generators and promises to improve the language-level model for writing asynchronous code.

It is currently in "stage 3" of the TC39 process, which means it's a "candidate" that needs more implementation experience.

Challenges in using post-mortem debugging with generators

Introduction

Generators were introduced in EcmaScript 2015. They provide a way to iterate over a set of values that are produced by a generating function.

Here's an example of how to use a generator:

function* myGenerator() {
/*
* fen.c
*
* cc fen.c -o fen
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
The original goal of this ticket was to handle the case when a volume would
unexpectedly change its IP address on its existing network due to, e.g. operator
changes, migration or bugs.
The first implementation that has been tried at
https://github.com/joyent/sdc-vmapi/tree/ZAPI-793 updates the
{{internal_metadata}} of VMs that mount a given volume during their {{start}}
workflow and update the IP address of any volume that they require.
While this solves part of the original use case, it has the fundamental
var assert = require('assert-plus');
var fs = require('fs');
var https = require('https');
var url = require('url');
var util = require('util');
var vasync = require('vasync');
var XML = require('xml-simple');
var JENKINS_API_TOKEN = process.env.JENKINS_API_TOKEN;
assert.string(JENKINS_API_TOKEN, 'JENKINS_API_TOKEN');
➜ mountain-gorilla git:(master) ✗ git diff | cat
diff --git a/configure b/configure
index 9556013..eae0c94 100755
--- a/configure
+++ b/configure
@@ -283,39 +283,53 @@ function preload_bits_from_manta() {
# of the actual latest path. Something similar but with a "-<buildstamp>"
# instead of "-latest" and we'll grab that into latest_dir.
#
- local count=0
diff --git a/lib/machines.js b/lib/machines.js
index 1ae8960..681acc7 100644
--- a/lib/machines.js
+++ b/lib/machines.js
@@ -271,7 +271,7 @@ function getListOptions(req) {
switch (req.params.type) {
case 'smartmachine':
- opts.predicate = '{ "and" [ ' +
+ opts.predicate = '{ "and": [ ' +
diff --git a/test/cnapi.test.js b/test/cnapi.test.js
index 6c67a44..169b7bc 100644
--- a/test/cnapi.test.js
+++ b/test/cnapi.test.js
@@ -8,10 +8,12 @@
* Copyright (c) 2018, Joyent, Inc.
*/
+var assert = require('assert-plus');
var bunyan = require('bunyan');