@@ -51,6 +51,8 @@ export interface ClusterAdapterOptions {
5151 requestsTimeout : number ;
5252}
5353
54+ function ignoreError ( ) { }
55+
5456/**
5557 * Returns a function that will create a ClusterAdapter instance.
5658 *
@@ -295,7 +297,7 @@ export class ClusterAdapter extends Adapter {
295297 message . nsp
296298 ) ;
297299
298- process . send ( message ) ;
300+ process . send ( message , null , { swallowErrors : true } , ignoreError ) ;
299301 }
300302
301303 /**
@@ -559,7 +561,7 @@ export function setupPrimary() {
559561 const workerId = message . data . workerId ;
560562 // emit back to the requester
561563 if ( hasOwnProperty . call ( cluster . workers , workerId ) ) {
562- cluster . workers [ workerId ] . send ( message ) ;
564+ cluster . workers [ workerId ] . send ( message , null , ignoreError ) ;
563565 }
564566 break ;
565567 default :
@@ -570,7 +572,7 @@ export function setupPrimary() {
570572 hasOwnProperty . call ( cluster . workers , workerId ) &&
571573 workerId !== emitterIdAsString
572574 ) {
573- cluster . workers [ workerId ] . send ( message ) ;
575+ cluster . workers [ workerId ] . send ( message , null , ignoreError ) ;
574576 }
575577 }
576578 }
@@ -580,11 +582,15 @@ export function setupPrimary() {
580582 // notify all active workers
581583 for ( const workerId in cluster . workers ) {
582584 if ( hasOwnProperty . call ( cluster . workers , workerId ) ) {
583- cluster . workers [ workerId ] . send ( {
584- source : MESSAGE_SOURCE ,
585- type : EventType . WORKER_EXIT ,
586- data : worker . id ,
587- } ) ;
585+ cluster . workers [ workerId ] . send (
586+ {
587+ source : MESSAGE_SOURCE ,
588+ type : EventType . WORKER_EXIT ,
589+ data : worker . id ,
590+ } ,
591+ null ,
592+ ignoreError
593+ ) ;
588594 }
589595 }
590596 } ) ;
0 commit comments