deno icon indicating copy to clipboard operation
deno copied to clipboard

`--watch` with `deno serve --parallel` works inconsistently

Open ayoreis opened this issue 1 year ago • 2 comments

// mod.ts

export default {
	fetch() {
		return new Response("Hello 1\n");
	},
} satisfies Deno.ServeDefaultExport;

Start the script with deno serve --parallel --watch mod.ts, and then edit the response text to "Hello 2\n".

If I now do bunch of requests I get a mix of the old and new responses (tested in both Firefox and Curl).

If I use DENO_JOBS=1 it works correctly. And strangely if the value is any higher, for example 2, it will serve more than 2 different responses (if there were enough many edits made to serve).

deno 1.46.3 (stable, release, x86_64-unknown-linux-gnu)
v8 12.9.202.5-rusty
typescript 5.5.2

ayoreis avatar Oct 07 '24 16:10 ayoreis

I was able to reproduce that using chrome, but wasn't able to reproduce it either using edge or Postman. What's the intended flow, updating all workers to have the latest changes?

HasanAlrimawi avatar Oct 21 '24 12:10 HasanAlrimawi

@HasanAlrimawi yes, all workers should be restarted with new code available.

bartlomieju avatar Oct 21 '24 12:10 bartlomieju