question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Critical issue: cote does not respond to sequential queries with delay

See original GitHub issue

Hello. I ran into the following issue: when I send query to same responder with some delay (say, 2 second), only first query get response. Here is code:

import cote from 'cote'

const delay = (msecs: number) => new Promise((resolve: () => void) => setTimeout(resolve, msecs))
const onResponse = (err: any, res: any) => {
  console.log('result:', res)
  console.log('error:', err)
}

const responder = new cote.Responder({ name: 'auth' })

responder.on('request', (req: any, cb: any) => {
  console.log('received request: ', req)
  cb(null, 'response')
})

async function main() {
  const requester = new cote.Requester({ name: 'req' })

  requester.send({ type: 'request', data: 'fooBar' }, onResponse)

  await delay(2000)
  requester.send({ type: 'request', data: 'fooBar' }, onResponse)

  await delay(2000)
  requester.send({ type: 'request', data: 'fooBar' }, onResponse)
}

main()

Only first query gets response using the code above.

OS: Windows 10 Node: v12.2.0 Cote: 0.20.0

I also tried to turn off windows firewall, no effect.

UPD1: I tried to launch time service example (from top of cote documentation), and if I launch time client.js repeatedly, I get answer only for first time after time_service.js start

UPD2: I noticed that example above will work if I will stop few other cote services. They have nothing common with example above, not a service name nor query type.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dasherswcommented, Jul 9, 2019

I updated the README to reflect this nature.

0reactions
georgyfarnievcommented, Jul 9, 2019

@dashersw thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

PostgreSQL-based application performance: latency ... - EDB
Every time your application runs a query it has to wait for the server to respond with success/failure and possibly a result set, ......
Read more >
6. Measurement Synchronization | Rohde & Schwarz
Therefore, the Idle periods in your program are taking place in VISA Read operations where your program waits for the instrument to respond...
Read more >
4 stages of major incident management process & RACI matrix
If a problem is created in response to the major incident, the problem manager owns the problem ticket. The problem manager tries to...
Read more >
Network Latency - Common Causes and Best Solutions | IR
The way we work is changing exponentially thanks to advancing technology, ... and longer delays are called a high-latency network (not so desirable)....
Read more >
Evaluation and management of suspected sepsis and septic ...
In this topic review, the management of sepsis and septic shock is ... However, the insertion of a central line should not delay...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found