Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This crashes sql server (running in docker on linux)
import mssql, { Request } from 'mssql'
import colors from 'colors'
import config from 'config'
import squel from 'squel'
const squelMssql = squel.useFlavour('mssql')
// import configurationStreams from './kafka/configuration'
// import runtimeStreams from './kafka/runtime'
const go = (name, value, conn) => new Request(conn)
.query(
`BEGIN
IF NOT EXISTS(
${
squelMssql
.select()
.from('tags.dbo.tags')
.where(`address = '${name}'`)
.toString()})
BEGIN
${
squelMssql
.insert()
.into('tags.dbo.tags')
.set('address', name)
.set('value', `${value}`)
.toString()}
END
ELSE
BEGIN
${
squelMssql
.update()
.table('tags.dbo.tags')
.set('value', `${value}`)
.where(`address = '${name}'`)
.toString()}
END
END`,
)
const connectionPool = new mssql
.ConnectionPool(
{
...config.get('connections.runtime'),
}
)
connectionPool
.on('error', (ex) => {
console.error(colors.red(`shutting down - connection error`), ex) // eslint-disable-line no-console
process.exit(1)
})
connectionPool
.connect()
.catch(
(ex) => {
console.error(colors.red(`shutting down - failed to create connection`), ex) // eslint-disable-line no-console
process.exit(1)
},
)
.then(
conn =>
Promise.all(
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
.map(
x =>
go(131455 + x, 'true', conn),
)
)
.then(
() => console.log('did that'),
)
.catch(
ex => console.error(ex),
),
)
)
/*
getspinlock pre-Sleep(): spid 0, 949046 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 948767 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 949839 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 949558 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 950618 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 950333 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:47:13.06 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30322339 ms.
2019-02-14 08:47:13.06 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30322344 ms.
getspinlock pre-Sleep(): spid 0, 951412 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 951123 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 951898 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 952190 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:48:13.06 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30382347 ms.
2019-02-14 08:48:13.07 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30382351 ms.
getspinlock pre-Sleep(): spid 0, 952690 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 952980 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 953466 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 953758 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 954550 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 954258 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:49:13.07 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30442354 ms.
2019-02-14 08:49:13.07 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30442354 ms.
getspinlock pre-Sleep(): spid 0, 955035 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 955327 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 956119 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 955828 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:50:13.08 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30502359 ms.
2019-02-14 08:50:13.08 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30502363 ms.
getspinlock pre-Sleep(): spid 0, 956896 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 956604 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 957686 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 957395 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:51:13.09 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30562370 ms.
2019-02-14 08:51:13.10 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30562386 ms.
getspinlock pre-Sleep(): spid 0, 958463 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 958174 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 959256 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 958966 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 960047 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 959743 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:52:13.11 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30622393 ms.
2019-02-14 08:52:13.12 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30622398 ms.
getspinlock pre-Sleep(): spid 0, 960828 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 960532 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 961623 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 961307 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:53:13.12 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30682402 ms.
2019-02-14 08:53:13.13 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30682418 ms.
getspinlock pre-Sleep(): spid 0, 962097 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 962399 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 962874 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 963191 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 963666 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 963968 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:54:13.14 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30742425 ms.
2019-02-14 08:54:13.14 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30742425 ms.
getspinlock pre-Sleep(): spid 0, 964443 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 964759 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 965235 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 965535 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:55:13.15 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30802433 ms.
2019-02-14 08:55:13.16 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30802441 ms.
getspinlock pre-Sleep(): spid 0, 966013 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 966326 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 966802 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 967104 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:56:13.17 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30862450 ms.
2019-02-14 08:56:13.18 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30862466 ms.
getspinlock pre-Sleep(): spid 0, 967578 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 967896 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 968371 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 968688 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 969146 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 969464 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:57:13.20 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30922483 ms.
2019-02-14 08:57:13.21 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30922500 ms.
getspinlock pre-Sleep(): spid 0, 969936 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 970256 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 971033 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 970712 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:58:13.22 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30982507 ms.
2019-02-14 08:58:13.23 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 30982515 ms.
getspinlock pre-Sleep(): spid 0, 971823 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 971488 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 972603 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 972277 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 973398 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 973051 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 08:59:13.25 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31042534 ms.
2019-02-14 08:59:13.25 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31042539 ms.
getspinlock pre-Sleep(): spid 0, 974174 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 973843 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 974966 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 974620 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 09:00:13.26 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31102540 ms.
2019-02-14 09:00:13.26 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31102544 ms.
getspinlock pre-Sleep(): spid 0, 975760 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 975410 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 976538 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 976184 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 09:01:13.26 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31162546 ms.
2019-02-14 09:01:13.27 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31162554 ms.
getspinlock pre-Sleep(): spid 0, 977331 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 976959 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 978124 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 977746 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 978906 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 978521 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 09:02:13.27 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31222557 ms.
2019-02-14 09:02:13.28 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31222562 ms.
getspinlock pre-Sleep(): spid 0, 979699 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 979309 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 980478 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 980086 yields on lock type "XDESMGR" (adr 00000007032A13C0)
2019-02-14 09:03:13.28 Server Process 0:0:0 (0x1220) Worker 0x0000000701B0E160 appears to be non-yielding on Scheduler 0. Thread creation time: 13194576992209. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31282565 ms.
2019-02-14 09:03:13.29 Server Process 0:0:0 (0x1470) Worker 0x00000006FFDB2160 appears to be non-yielding on Scheduler 1. Thread creation time: 13194577114280. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 100%. System Idle 0%. Interval: 31282569 ms.
getspinlock pre-Sleep(): spid 0, 981264 yields on lock type "XDESMGR" (adr 00000007032A13C0)
getspinlock pre-Sleep(): spid 0, 980855 yields on lock type "XDESMGR" (adr 00000007032A13C0)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.