File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,18 +74,6 @@ func addRegularThread() (*phpThread, error) {
7474 return thread , nil
7575}
7676
77- func removeRegularThread () error {
78- regularThreadMu .RLock ()
79- if len (regularThreads ) <= 1 {
80- regularThreadMu .RUnlock ()
81- return CannotRemoveLastThreadError
82- }
83- thread := regularThreads [len (regularThreads )- 1 ]
84- regularThreadMu .RUnlock ()
85- thread .shutdown ()
86- return nil
87- }
88-
8977func addWorkerThread (worker * worker ) (* phpThread , error ) {
9078 thread := getInactivePHPThread ()
9179 if thread == nil {
@@ -96,19 +84,6 @@ func addWorkerThread(worker *worker) (*phpThread, error) {
9684 return thread , nil
9785}
9886
99- func removeWorkerThread (worker * worker ) error {
100- worker .threadMutex .RLock ()
101- if len (worker .threads ) <= 1 {
102- worker .threadMutex .RUnlock ()
103- return CannotRemoveLastThreadError
104- }
105- thread := worker .threads [len (worker .threads )- 1 ]
106- worker .threadMutex .RUnlock ()
107- thread .shutdown ()
108-
109- return nil
110- }
111-
11287// scaleWorkerThread adds a worker PHP thread automatically
11388func scaleWorkerThread (worker * worker ) {
11489 scalingMu .Lock ()
Original file line number Diff line number Diff line change @@ -150,8 +150,10 @@ func (handler *workerThread) waitForWorkerRequest() bool {
150150 c .Write (zap .String ("worker" , handler .worker .fileName ))
151151 }
152152
153- if handler .state .compareAndSwap (stateTransitionComplete , stateReady ) {
153+ // worker threads are 'ready' only after they first reach frankenphp_handle_request()
154+ if handler .state .is (stateTransitionComplete ) {
154155 metrics .ReadyWorker (handler .worker .fileName )
156+ handler .state .set (stateReady )
155157 }
156158
157159 handler .state .markAsWaiting (true )
You can’t perform that action at this time.
0 commit comments