aboutsummaryrefslogtreecommitdiff
path: root/src/util/scheduler.c
Commit message (Collapse)AuthorAge
* NEWS: Refactoring components under src/ into lib/, plugin/, cli/ and service/Martin Schanzenbach2023-10-18
| | | | | This also includes a necessary API refactoring of crypto from IDENTITY to UTIL.
* -remove dead variable, obsoleted by patch for #7617Christian Grothoff2023-02-06
|
* UTIL: use dedicated marker in ready queue.ulfvonbelow2023-02-06
| | | | | | | | | | | | | | | This inserts a dedicated dummy marker task at the end of the ready queue at the start of a pass. Because this marker task isn't visible to users of the scheduler, it can't be canceled while the pass is being run. Additionally, switching which ready queue is being run partway through by scheduling a higher-priority task to immediately run also places this dummy marker. This resolves both erroneous cases by which a pass can accidentally run an unbounded number of tasks. This also modifies GNUNET_SCHEDULER_get_load to not be misled by this extra dummy task, and adds the now-passing test cases to the test suite. Signed-off-by: Christian Grothoff <christian@grothoff.org>
* BUILD: Attempt to disentable platform.h, gnunet_common.h and ↵Martin Schanzenbach2022-12-04
| | | | gnunet_private_config.h insanity
* BUILD: Improve platform-specific includesMartin Schanzenbach2022-12-01
| | | | | | | | | | | This change allows third party programs to use gnunet either with the platform header from the sources used to build to gnunet, or use their own platform header by defining GNUNET_CUSTOM_PLATFORM_H which will be included in its stead. This also means that programs no longer must include "platform.h" (or similar) manually. The change (should be) backwards compatible to some degree. Fixes #4615
* -DOC: Comment stripping pass in UTIL scheduler libraryWillow Liquorice2022-10-03
|
* fix scheduler bug with same-priority immediately-ready tasks possibly ↵Christian Grothoff2022-05-17
| | | | hogging the scheduler
* help fixing #7105Christian Grothoff2021-11-25
|
* -Fix several incorrect uses of `i.e.'Alessio Vanni2021-04-24
| | | | With some other changes to sentences here and there as I found appropriate.
* spell checkingChristian Grothoff2020-11-14
|
* merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188Christian Grothoff2020-07-18
|
* make GNUNET_freez default, have GNUNET_free_nz for cases where that does not ↵Christian Grothoff2020-04-21
| | | | work
* better task orderingChristian Grothoff2020-02-15
|
* fix task prioritization with recent hackChristian Grothoff2020-02-04
|
* speed up running of tasks via GNUNTE_SCHEDULER_add_now() by a factor of at ↵Christian Grothoff2020-02-04
| | | | least 5
* tighten formatting rulesChristian Grothoff2019-10-31
|
* global reindent, now with uncrustify hook enabledChristian Grothoff2019-10-05
|
* remove CYGWIN codeblocks, drop vendored Windows openvpn, drop win32 specific ↵ng02019-09-10
| | | | | | | | | files. configures and builds okay. testsuite wasn't checked, will be checked. diff including the plibc removal is now around 14370 lines of code less.
* uncrustify as demanded.ng02019-09-08
|
* Implement asynchronous scope identifiers.Florian Dold2019-05-10
| | | | | | | | | | | Without entering an asynchronous scope, logs are the same before. When entering an asynchronous scope (either thread-based of scheduler/task-based), all log lines within an asynchronous scope contain its ID. Currently this is only used in GNU Taler, for debugging requests across multiple services. This allows us to get all log lines pertaining to a particular request for a user or another service.
* misc work on TNGChristian Grothoff2019-04-15
|
* Florian Weimer writes:Christian Grothoff2019-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Christian Grothoff: > I'm seeing some _very_ odd behavior with processes hanging on exit (?) > with GNU libc 2.28-6 on Debian (amd64 threadripper). This seems to > happen at random (for random tests, with very low frequency!) in the > GNUnet (Git master) testsuite when a child process is about to exit. It looks like you call exit from a signal handler, see src/util/scheduler.c: /** * Signal handler called for signals that should cause us to shutdown. */ static void sighandler_shutdown () { static char c; int old_errno = errno; /* backup errno */ if (getpid () != my_pid) exit (1); /* we have fork'ed since the signal handler was created, * ignore the signal, see https://gnunet.org/vfork discussion */ GNUNET_DISK_file_write (GNUNET_DISK_pipe_handle (shutdown_pipe_handle, GNUNET_DISK_PIPE_END_WRITE), &c, sizeof (c)); errno = old_errno; } In general, this results in undefined behavior because exit (unlike _exit) is not an async-signal-safe function. I suspect you either call the exit function while a fork is in progress, or since you register this signal handler multiple times for different signals: sh->shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown); sh->shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown); one call to exit might interrupt another call to exit if both signals are delivered to the process. The deadlock you see was introduced in commit 27761a1042daf01987e7d79636d0c41511c6df3c ("Refactor atfork handlers"), first released in glibc 2.28. The fork deadlock will be gone (in the single-threaded case) if Debian updates to the current release/2.28/master branch because we backported commit 60f80624257ef84eacfd9b400bda1b5a5e8e7816 ("nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161]") there. But this will not help you. Even without the deadlock, I expect you still experience some random corruption during exit, but it's going to be difficult to spot. Thanks, Florian
* src: for every AGPL3.0 file, add SPDX identifier.ng02019-01-14
|
* GNUNET_SCHEDULER_do_work: always check if shutdown is necessary and update ↵lurchi2018-07-29
| | | | | | wakeup time
* Remove restrictive and unnecessary assertlurchi2018-07-24
| | | | Using the SCHEDULER_add* functions is now allowed before the first call to GNUNET_SCHEDULER_do_work.
* paragraph for gnunet devs that don't know how to use the webpsyc://loupsycedyglgamf.onion/~lynX2018-06-07
|
* glitch in the license text detected by hyazinthe, thank you!psyc://loupsycedyglgamf.onion/~lynX2018-06-07
|
* first batch of license fixes (boring)psyc://loupsycedyglgamf.onion/~lynX2018-06-05
|
* make some functions static, ensure shutdown tasks could be run repeatedly if ↵Christian Grothoff2018-03-31
| | | | 1st shutdown did not finish the process
* disable debug instrumentation againChristian Grothoff2018-03-08
|
* better error reporting from schedulerChristian Grothoff2018-03-08
|
* fix loggingChristian Grothoff2018-03-03
|
* fix newline, reduce verbosityChristian Grothoff2018-03-03
|
* improve documentationlurchi2018-02-01
|
* scheduler API change to allow use with js event looplurchi2018-02-01
| | | | | | | | | - GNUNET_SCHEDUELR_run_with_driver has been replaced with GNUNET_SCHEDULER_driver_init and GNUNET_SCHEDUELR_driver_done - GNUNET_SCHEDULER_run_from_driver has been renamed to GNUNET_SCHEDULER_do_work (as it's no longer being called from a driver callback) - documentation has been updated
* really make GNUNET_SCHEDULER_run_from_driver more graceful (must have been late)lurchi2018-01-27
|
* make GNUNET_SCHEDULER_run_from_driver more gracefullurchi2018-01-24
| | | | | | | GNUNET_SCHEDULER_run_from_driver may now be called without any tasks being ready if the timeout has not been reached yet. A warning is printed because it may be a programming error in the driver (see comments)
* catch early return of select before call to GNUNET_SCHEDULER_run_from_driverlurchi2018-01-23
|
* Revert "add assertion for debugging"lurchi2018-01-23
| | | | This reverts commit d45c008e677fa2fbff03e22745390d4775b031d2.
* add assertion for debugginglurchi2018-01-23
|
* remove unnecessary checklurchi2018-01-22
| | | | The reason field of tasks in the pending_timeout queue is never modified while the tasks are in the queue
* use absolute times in driverlurchi2018-01-22
| | | | this shouldn't change anything but makes debugging easier.
* indentation fixesChristian Grothoff2018-01-21
|
* check if no tasks are left after the driver looplurchi2018-01-21
| | | | | | - add assertions to make sure all tasks have been run or cancelled - don't cancel all pending tasks during shutdown, only cancel the two internal tasks scheduled in GNUNET_SCHEDULER_run_with_driver
* fix loop responsible for finding tasks with expired timeoutlurchi2018-01-18
|
* always check priority given by userslurchi2018-01-17
|
* return now if we found a task that is ready (optimization)lurchi2018-01-16
|
* only check fdsets when select selected something (optimization)lurchi2018-01-16
|
* Revert "call GNUNET_abort_ directly for debugging purposes"lurchi2018-01-16
| | | | This reverts commit 5c4ae18d2e58c8bf3ba60a4f69251e304fbb9915.
* call GNUNET_abort_ directly for debugging purposeslurchi2018-01-16
|