Commit graph

33 commits

Author SHA1 Message Date
serkixenos
29d2f72b24 Remove as much warnings from build log as possible 2020-10-29 21:47:30 +01:00
pbattu
00efb88ac7 fc changes to support ubuntu-18.04 upgrade 2019-05-21 18:42:14 -03:00
Daniel Larimer
83a9e4d7c8 Update NTP performance requirments
NTP server must ACK within 300ms or time will not be set.
Removed extra printing
2015-09-23 16:22:11 -04:00
Eric Frias
307252e23a Call fc:🧵:quit() on thread destruction, and remove code that explicitly terminates threads from the destructors of the objects that own those threads.
Fix fc::thread to set the thread name in the Debugger when the name is set after thread construction.
When terminating a thread, cancel any tasks that have been schedule()d or async()ed but have not yet started executing.
When canceling a task blocked on a fc::mutex, notify the thread to reschedule the task to allow it to clean up the mutex's block list.
Fix a bug in managing the recursive lock count when tasks block on a fc::mutex
Reorder the code that manages the hard links for log files to avoid an exception generated by unlinking a locked file on Windows.
2014-10-21 10:25:28 -04:00
Vikram Rajkumar
7ddf882459 Fix linux build 2014-10-17 13:23:51 -04:00
Eric Frias
06ca6d8981 Fix bug that was causing NTP to fail to update after the first check 2014-10-07 11:49:35 -04:00
Eric Frias
82dd74add0 Retry NTP requests more frequently if we don't receive a (valid) reply 2014-10-07 11:10:27 -04:00
Eric Frias
0d61966a1c Improve NTP math 2014-10-07 10:31:19 -04:00
dnotestein
c4e814d7de Added more logging to ntp and fixed code indentation. 2014-09-30 10:53:23 -04:00
dnotestein
53196706f0 Add some more logging to ntp time synchronization code. 2014-09-29 18:55:35 -04:00
Eric Frias
b5414af3ce Restore an accidentally-commented-out line that was preventing NTP from restarting after encountering an error. 2014-09-14 19:53:08 -04:00
Eric Frias
3ee5f756fb Fix a yield-during-catch bug in udp_socket, and add a shared_ptr version of udp_socket::send_to() which will avoid reading from uninitialized memory in the face of cancellation. 2014-09-12 19:42:25 -04:00
Eric Frias
aa6882b3b7 Allow us to safely cancel tasks that are executing asynchronous network reads
and writes.  This was previously unsafe because we almost always passed read/write
buffers to boost that were on the stack. Canceling the task deleted the stack and
therefore the buffer, but couldn't reliably prevent boost from writing to the buffer
if data came in after the cancel.  This commit adds variants of the read and write
functions that take a shared_ptr<char> instead of a raw char* as the buffer, and
these variants will ensure the shared_ptr will outlive the boost::asio read/write.
2014-09-09 11:10:37 -04:00
Eric Frias
db8eb2e5d4 Revert "Instead of canceling the read_loop, close the socket and wait for the read_loop to finish as a result. This prevents the receive_from from writing into the buffer (which is on the stack!) after the task is canceled. This caused nasty intermittent exception stack unwind errors."
This reverts commit c79cbdae8e.
2014-09-09 11:08:27 -04:00
dnotestein
c79cbdae8e Instead of canceling the read_loop, close the socket and wait for the read_loop to finish as a result. This prevents the receive_from from writing into the buffer (which is on the stack!) after the task is canceled. This caused nasty intermittent exception stack unwind errors. 2014-09-08 17:23:03 -04:00
dnotestein
10fdbcf5b3 Dequeue a thread from a blocking promise's notify list when the all the thread's tasks that are waiting on that promise are canceled. This prevents a crash when the promise is fulfilled after the thread is destroyed.
Re-organize read-loop execution to avoid crashes in read_loop on Win32 when ntp object destructs. Call quit on ntp_thread when ntp object destructs to free up thread (eventually we need to make fc::threads call quit in their destructor, but more work is required to make that work properly).
~fc::udp_socket now closes socket on destruction (consider doing this for tcp sockets as well).
2014-09-08 15:31:13 -04:00
Eric Frias
ac385d1f6b Allow the user to supply a reason string when canceling a task (useful for debugging) 2014-08-27 14:07:44 -04:00
Eric Frias
d188b138d6 Allow fc::canceled_exception to pass through places where we were catching and ignoring all fc::exceptions 2014-08-25 18:43:12 -04:00
Eric Frias
92d29ac657 Prevent crash at shutdown rescheduling NTP task 2014-08-12 15:19:44 -04:00
dnotestein
7cc69f3bb7 Set canceled flag in task's context object so that we cancel out of active tasks when they try to resume. Wrap a try-catch block around tcp and udp resolve requests to convert any non-fc exceptions to fc exceptions. Minor change to clarify design intent that request_time_task should always be running in _ntp_thread. 2014-08-01 11:31:36 -04:00
dnotestein
9e320a3db8 Add descriptions for a bunch of async tasks, remove logging during thread::quit to avoid crashes for now until we cleanup thread quit code 2014-07-27 00:09:15 -04:00
Eric Frias
b460fd6b41 Cleanup all async tasks on exit, thread safety, work in progress. 2014-07-26 18:22:38 -04:00
Eric Frias
c208a968b2 Fix ntp on win32 2014-07-25 14:40:47 -04:00
Daniel Larimer
456c81df27 fix potential errors in NTP caused by running in main thread 2014-06-25 23:32:09 -04:00
Eric Frias
331e6aac7d Convert networking exceptions to fc::exceptions to properly catch them in NTP code (fixes at least some of the shutdown crashes) 2014-06-20 12:22:37 -04:00
Daniel Larimer
bb3c3ec118 fix NTP flooding issue 2014-06-16 14:04:36 -04:00
Eric Frias
6898484321 Remove a few annoying unreferenced variables 2014-06-16 12:03:20 -04:00
Daniel Larimer
b7ad720647 updating ntp service 2014-06-16 11:17:29 -04:00
Eric Frias
a1604e3708 Fix NTP on Win32 2014-06-12 08:40:24 -04:00
Eric Frias
8ef1c4e0a7 Add include for ntohl() on linux 2014-06-11 13:56:03 -07:00
Eric Frias
59d3e80fb7 Add include to fix win32 build 2014-06-11 16:32:47 -04:00
Daniel Larimer
75ec020227 fix ntp 2014-06-11 15:30:30 -04:00
Daniel Larimer
0c64d208d9 adding ntp support to fc 2014-06-11 15:17:28 -04:00