Special Considerations for Windows

Special Considerations for Windows

This page applies to instances running directly on Windows. It does not apply to instances running inside Linux Docker containers on Windows.

Overview

Windows does not support Unix-style signals. Signals are software interrupts that applications use to detect important events – for example, most operating systems use a signal to tell an application that shutdown has been requested so that it can perform any needed cleanup.

This means that automatic seat deactivation does not work on Windows in most scenarios. The only scenario where it works automatically is when the instance is started from an interactive command prompt or shell and stopped with CTRL+C.

Where automatic deactivation is not possible, the seat is reclaimed once the heartbeat expires, or it can be released right away with the CLI (see Listing and Manually Deactivating Seats). Configuring the instance for manual deactivation makes this behavior explicit (see Automatic vs. Manual Seat Deactivation).

Automatic Seat Deactivation in PM2 for Windows

If deploying an instance in PM2 for Windows, automatic seat deactivation only works if the process is started with PM2’s --shutdown-with-message option. This option causes PM2 to send an Inter-Process Communication (IPC) message to the process; Profound.js and Profound API listen for this message and perform automatic seat deactivation before shutting down.

For more information, see the Windows Graceful Stop section of the PM2 documentation.

If deploying in PM2 on other operating systems, standard shutdown using signals is recommended (see Autostart Profoundjs with PM2).

Automatic Seat Deactivation in Visual Studio Code for Windows

Instances started with the VS Code debugger will not perform automatic seat deactivation when shut down using the stop button in the debug toolbar:

To work around this, shut down using an alternate technique. In your launch configuration, set the console field to “integratedTerminal”:

launch.json
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "skipFiles": [ "<node_internals>/**" ], "program": "${workspaceFolder}\\start.js", // Run in the integrated terminal so CTRL+C can be used to shut down cleanly. "console": "integratedTerminal", "env": { "PJS_FLOATING_AUTHORIZATION": "plls_api_xxx" } } ] }

When started with this configuration, the instance launches in a debug terminal window. Type CTRL+C in the terminal window to shut down with automatic seat deactivation:

Wait a moment after typing, and the deactivation messages appear: