Commit f592e0f
authored
refactor: decouple worker threads from non-worker threads (#1137)
* Decouple workers.
* Moves code to separate file.
* Cleans up the exponential backoff.
* Initial working implementation.
* Refactors php threads to take callbacks.
* Cleanup.
* Cleanup.
* Cleanup.
* Cleanup.
* Adjusts watcher logic.
* Adjusts the watcher logic.
* Fix opcache_reset race condition.
* Fixing merge conflicts and formatting.
* Prevents overlapping of TSRM reservation and script execution.
* Adjustments as suggested by @dunglas.
* Adds error assertions.
* Adds comments.
* Removes logs and explicitly compares to C.false.
* Resets check.
* Adds cast for safety.
* Fixes waitgroup overflow.
* Resolves waitgroup race condition on startup.
* Moves worker request logic to worker.go.
* Removes defer.
* Removes call from go to c.
* Fixes merge conflict.
* Adds fibers test back in.
* Refactors new thread loop approach.
* Removes redundant check.
* Adds compareAndSwap.
* Refactor: removes global waitgroups and uses a 'thread state' abstraction instead.
* Removes unnecessary method.
* Updates comment.
* Removes unnecessary booleans.
* test
* First state machine steps.
* Splits threads.
* Minimal working implementation with broken tests.
* Fixes tests.
* Refactoring.
* Fixes merge conflicts.
* Formatting
* C formatting.
* More cleanup.
* Allows for clean state transitions.
* Adds state tests.
* Adds support for thread transitioning.
* Fixes the testdata path.
* Formatting.
* Allows transitioning back to inactive state.
* Fixes go linting.
* Formatting.
* Removes duplication.
* Applies suggestions by @dunglas
* Removes redundant check.
* Locks the handler on restart.
* Removes unnecessary log.
* Changes Unpin() logic as suggested by @withinboredom
* Adds suggestions by @dunglas and resolves TODO.
* Makes restarts fully safe.
* Will make the initial startup fail even if the watcher is enabled (as is currently the case)
* Also adds compareAndSwap to the test.
* Adds comment.
* Prevents panic on initial watcher startup.1 parent 2676bff commit f592e0f
File tree
20 files changed
+1076
-459
lines changed- testdata
20 files changed
+1076
-459
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | 230 | | |
233 | 231 | | |
234 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
815 | | - | |
816 | 814 | | |
| 815 | + | |
| 816 | + | |
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
835 | | - | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
836 | 840 | | |
837 | 841 | | |
838 | 842 | | |
| |||
841 | 845 | | |
842 | 846 | | |
843 | 847 | | |
| 848 | + | |
| 849 | + | |
844 | 850 | | |
845 | 851 | | |
846 | 852 | | |
| |||
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
861 | | - | |
862 | | - | |
863 | 867 | | |
864 | 868 | | |
865 | 869 | | |
866 | 870 | | |
867 | | - | |
| 871 | + | |
868 | 872 | | |
869 | 873 | | |
870 | 874 | | |
| |||
892 | 896 | | |
893 | 897 | | |
894 | 898 | | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
| 899 | + | |
917 | 900 | | |
918 | 901 | | |
919 | 902 | | |
| |||
929 | 912 | | |
930 | 913 | | |
931 | 914 | | |
932 | | - | |
933 | | - | |
934 | | - | |
| 915 | + | |
935 | 916 | | |
936 | 917 | | |
937 | 918 | | |
938 | | - | |
| 919 | + | |
939 | 920 | | |
940 | 921 | | |
941 | 922 | | |
942 | 923 | | |
943 | | - | |
944 | | - | |
945 | 924 | | |
946 | 925 | | |
947 | 926 | | |
948 | 927 | | |
949 | 928 | | |
950 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
951 | 939 | | |
952 | 940 | | |
953 | 941 | | |
| |||
960 | 948 | | |
961 | 949 | | |
962 | 950 | | |
963 | | - | |
964 | | - | |
965 | 951 | | |
966 | 952 | | |
967 | 953 | | |
| |||
970 | 956 | | |
971 | 957 | | |
972 | 958 | | |
973 | | - | |
974 | | - | |
975 | 959 | | |
976 | 960 | | |
977 | 961 | | |
| |||
0 commit comments