Commit Graph

87 Commits (9abf29e9955b2ca039482ca2cb3fcffbe7375175)

Author SHA1 Message Date
Ansariel 3fed8d9fc4 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
# Conflicts:
#	doc/contributions.txt
#	indra/llcommon/llsdserialize.cpp
#	indra/llcommon/llsdserialize.h
#	indra/newview/llpathfindingnavmesh.cpp
2023-05-17 23:33:50 +02:00
Ansariel 7bcb251661 Merge branch 'DRTVWR-567' of https://github.com/secondlife/viewer
# Conflicts:
#	autobuild.xml
#	indra/llmessage/llcoproceduremanager.cpp
#	indra/llui/lllayoutstack.h
#	indra/newview/llfloatersidepanelcontainer.h
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventoryfilter.cpp
#	indra/newview/llinventoryfilter.h
#	indra/newview/llinventorymodelbackgroundfetch.cpp
#	indra/newview/llinventorymodelbackgroundfetch.h
#	indra/newview/llinventorypanel.cpp
#	indra/newview/llpanelmaininventory.cpp
#	indra/newview/llpanelmaininventory.h
#	indra/newview/lltexturectrl.cpp
#	indra/newview/skins/default/xui/en/panel_main_inventory.xml
2023-04-21 12:08:40 +02:00
Andrey Kleshchev 16712d2437 SL-19493 Fix inventory log spam 2023-03-30 23:44:40 +03:00
Ansariel 8d154eaa8c Merge branch 'contribute' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llappearance/llavatarappearance.cpp
#	indra/llappearance/lldriverparam.cpp
#	indra/llappearance/llwearable.cpp
#	indra/llcommon/llerror.cpp
#	indra/llcommon/llqueuedthread.cpp
#	indra/llcommon/llsdserialize.h
#	indra/llcommon/llthreadsafequeue.h
#	indra/newview/app_settings/settings.xml
#	indra/newview/llpathfindingnavmesh.cpp
#	indra/newview/llviewerassetstorage.cpp
#	indra/newview/llviewerdisplay.cpp
#	indra/newview/skins/default/xui/de/floater_flickr.xml
#	indra/newview/skins/default/xui/de/panel_flickr_photo.xml
#	indra/newview/skins/default/xui/en/floater_about_land.xml
#	indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml
#	indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml
#	indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
#	indra/newview/skins/default/xui/fr/floater_flickr.xml
#	indra/newview/skins/default/xui/fr/panel_flickr_account.xml
#	indra/newview/skins/default/xui/fr/panel_flickr_photo.xml
#	indra/newview/skins/default/xui/it/floater_flickr.xml
#	indra/newview/skins/default/xui/it/panel_flickr_photo.xml
#	indra/newview/skins/default/xui/ja/floater_flickr.xml
#	indra/newview/skins/default/xui/ja/panel_flickr_photo.xml
#	indra/newview/skins/default/xui/pl/floater_avatar_render_settings.xml
#	indra/newview/skins/default/xui/pl/floater_ban_duration.xml
#	indra/newview/skins/default/xui/pl/floater_camera_presets.xml
#	indra/newview/skins/default/xui/pl/floater_classified.xml
#	indra/newview/skins/default/xui/pl/floater_create_landmark.xml
#	indra/newview/skins/default/xui/pl/floater_delete_pref_preset.xml
#	indra/newview/skins/default/xui/pl/floater_fixedenvironment.xml
#	indra/newview/skins/default/xui/pl/floater_flickr.xml
#	indra/newview/skins/default/xui/pl/floater_linkreplace.xml
#	indra/newview/skins/default/xui/pl/floater_load_pref_preset.xml
#	indra/newview/skins/default/xui/pl/floater_my_environments.xml
#	indra/newview/skins/default/xui/pl/floater_my_scripts.xml
#	indra/newview/skins/default/xui/pl/floater_notifications_tabbed.xml
#	indra/newview/skins/default/xui/pl/floater_pick_track.xml
#	indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml
#	indra/newview/skins/default/xui/pl/floater_preferences_view_advanced.xml
#	indra/newview/skins/default/xui/pl/floater_preview_trash.xml
#	indra/newview/skins/default/xui/pl/floater_profile.xml
#	indra/newview/skins/default/xui/pl/floater_settings_picker.xml
#	indra/newview/skins/default/xui/pl/floater_simple_outfit_snapshot.xml
#	indra/newview/skins/default/xui/pl/menu_avatar_rendering_settings.xml
#	indra/newview/skins/default/xui/pl/menu_avatar_rendering_settings_add.xml
#	indra/newview/skins/default/xui/pl/panel_flickr_photo.xml
#	indra/newview/skins/default/xui/pl/panel_progress.xml
#	indra/newview/skins/default/xui/pl/panel_settings_sky_atmos.xml
#	indra/newview/skins/default/xui/pl/panel_settings_sky_clouds.xml
#	indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml
#	indra/newview/skins/default/xui/ru/floater_flickr.xml
#	indra/newview/skins/default/xui/ru/panel_flickr_account.xml
#	indra/newview/skins/default/xui/ru/panel_flickr_photo.xml
2023-01-13 15:19:29 +01:00
Nat Goodspeed 769bf46a3f SL-14399: Ditch overflow queue LLViewerAssetStorage::mCoroWaitList.
mCoroWaitList was introduced to prevent an assertion failure crash:
LLCoprocedureManager never expects to fill LLCoprocedurePool::mPendingCoprocs
queue. The queue limit was arbitrarily set to 4096 some years ago, but in
practice LLViewerAssetStorage can post way more requests than that.

LLViewerAssetStorage checked whether the target LLCoprocedureManager pool's
queue looked close to full, and if so posted the pending request to its
mCoroWaitList instead. But then it had to override the base LLAssetStorage
method checkForTimeouts() to continually check whether pending tasks could be
moved from mCoroWaitList to LLCoprocedureManager.

A simpler solution is to enlarge LLCorpocedureManager::DEFAULT_QUEUE_SIZE, the
upper limit on mPendingCoprocs. Since mCoroWaitList was an unlimited queue,
making DEFAULT_QUEUE_SIZE "very large" does not increase the risk of runaway
memory consumption.
2022-12-07 09:50:02 -05:00
Ansariel 94534f4c88 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2021-04-30 23:25:06 +02:00
Andrey Kleshchev 3f31901640 Merge master (DRTVWR-515) into DRTVWR-516-maint
# Conflicts:
#	autobuild.xml
#	doc/contributions.txt
#	indra/llcommon/llcoros.cpp
#	indra/llmessage/llcoproceduremanager.cpp
#	indra/newview/llfloaterfixedenvironment.cpp
#	indra/newview/llfloaterimsessiontab.cpp
2021-04-29 21:00:25 +03:00
Ansariel c36098c881 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2021-03-03 21:20:43 +01:00
Ansariel 35781178ec Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2021-03-02 21:19:39 +01:00
Ansariel d07c89ee6d Squelch some coproc logspam 2021-02-19 10:15:37 +01:00
Ansariel f55bab800a FIRE-30765: Fix more coproc pool creation threading crashes - yay! 2021-02-19 01:17:25 +01:00
Ansariel 1cf4be8423 Turn this into a warning 2021-02-18 19:32:16 +01:00
Ansariel 425a971604 Don't LL_ERRS out if trying to create a copro pool a second time 2021-02-15 12:30:22 +01:00
Ansariel 78daeae740 Merge branch 'DRTVWR-516-maint' of https://bitbucket.org/lindenlab/viewer 2021-02-15 10:22:20 +01:00
Andrey Kleshchev f06ebd054b SL-14807 Missed a pool init in unused constructor, additional protections 2021-02-14 20:42:30 +02:00
Andrey Kleshchev 4a3e32e732 SL-14807 Adjusted unit test 2021-02-11 02:49:13 +02:00
Andrey Kleshchev 24d4517458 SL-14807 Viewer crashes when creating an experience 2021-02-10 01:10:36 +02:00
Ansariel 7458601374 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2021-02-02 00:05:53 +01:00
Ansariel fe1ecfe7cc FIRE-30731: Make use of LL's ugly SOC-violating workaround for out-of-the-blue fix for ExpCache coroutine pool creation crash - presumably... 2021-02-01 22:37:41 +01:00
Ansariel 6c587d437d Merge branch 'DRTVWR-515-maint' of https://bitbucket.org/lindenlab/viewer 2020-12-02 08:17:58 +01:00
Andrey Kleshchev 71bca1d860 SL-14399 Enqueue into 'LLViewerAssetStorage::assetRequestCoro' failed 2020-11-26 22:27:48 +02:00
Ansariel f9b6380689 Merge branch 'DRTVWR-507-maint' of https://bitbucket.org/lindenlab/viewer 2020-10-14 23:57:09 +02:00
Andrey Kleshchev 5172f5d6d6 SL-14037 BugSplat Crash #646590: Enqueue failed in AIS 2020-10-01 22:36:52 +03:00
Ansariel fe10f171d3 Merge branch 'DRTVWR-503-maint' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/llmessage/llcoproceduremanager.cpp
#	indra/newview/llinventorypanel.cpp
#	indra/newview/llpanelmaininventory.cpp
#	indra/newview/skins/default/xui/en/panel_main_inventory.xml
#	indra/newview/skins/default/xui/en/strings.xml
2020-09-09 19:34:33 +02:00
Ansariel dc0e4941e2 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2020-09-09 19:27:48 +02:00
Andrey Kleshchev a42045994d SL-13555 'Second Life quit unexpectedly' error message 2020-08-28 01:30:37 +03:00
Andrey Kleshchev 2f52a37e6a SL-13811 Crash on coroprocedure 2020-08-28 00:33:25 +03:00
Andrey Kleshchev ed9a0bd2e6 SL-13811 Crash on coroprocedure
Coroprosedure should stop on 'stop' exception
2020-08-21 12:57:21 +02:00
Andrey Kleshchev e4350fb9ef SL-13811 Crash on coroprocedure
Coroprosedure should stop on 'stop' exception
2020-08-20 23:44:45 +03:00
Ansariel 6239f5b5d6 Merge branch 'DRTVWR-503-maint' of https://bitbucket.org/lindenlab/viewer 2020-08-18 18:26:28 +02:00
Ansariel 8ac53f8a76 Revert "Attempt to fix the VAAssetStorage pool creation issue" because of LL's upcoming ewwwww-hackme-fix
This reverts commit e7f5063944.
2020-08-18 18:25:34 +02:00
Andrey Kleshchev 58ba75f6dd SL-13783 Workaround for enqueueCoprocedure() crash #2 2020-08-18 16:23:59 +03:00
Andrey Kleshchev fa0cc7b6d2 Merged in SL-13783 and SL-13789 2020-08-17 20:49:56 +00:00
Andrey Kleshchev 80fe2157fe SL-13783 Workaround for enqueueCoprocedure() crash with asset storage 2020-08-17 21:52:28 +03:00
Ansariel e7f5063944 Attempt to fix the VAAssetStorage pool creation issue 2020-08-13 20:33:26 +02:00
Ansariel ffd96d181a Merge branch 'master' of https://bitbucket.org/lindenlab/viewer 2020-08-11 18:18:07 +02:00
Andrey Kleshchev cca777fdf5 SL-13679 Event pump DupListenerName crash at login 2020-07-24 23:53:57 +03:00
Nicky Dasmijn 27715d4d03 Merge remote-tracking branch 'll/d476' into fs-eep-vs2017-d476 2020-05-21 06:54:02 +02:00
Nat Goodspeed b7d60f650d DRTVWR-476: Fix LLCoprocedurePool::enqueueCoprocedure() shutdown crash. 2020-05-20 10:44:34 -04:00
Nicky Dasmijn 13b4bd5832 Make sure coproc gets destroyed after each iteration.
Making coproc scoped to the for loop will make sure the destructor gets
called every loop iteration. Keeping it's scope outside the for loop
means the pointer keeps valid till the next assigment that happens
inside pop_wait_for when it gets assigned a new value.

Triggering the dtor inside pop_wait_for can lead to deadlock when inside
the dtor a coroutine tries to call enqueueCoprocedure (this happens).
enqueueCoprocedure then will try to grab the lock for try_push but this
lock is still held by pop_wait_for.
2020-05-19 21:27:16 +02:00
Nat Goodspeed 003ba682a1 DRTVWR-476: Clean up reverting to boost::fibers::buffered_channel. 2020-05-19 14:38:14 -04:00
Nat Goodspeed 9d428662f8 DRTVWR-476: Revert "Use LLThreadSafeQueue, not boost::fibers::buffered_channel."
This reverts commit bf8aea5059.

Try boost::fibers::buffered_channel again with Boost 1.72.
2020-05-19 11:32:24 -04:00
Nat Goodspeed ce36ef8242 DRTVWR-476: Use LLThreadSafeQueue::close() to shut down coprocs.
The tactic of pushing an empty QueuedCoproc::ptr_t to signal coprocedure close
only works for LLCoprocedurePools with a single coprocedure (e.g. "Upload" and
"AIS"). Only one coprocedureInvokerCoro() coroutine will pop that empty
pointer and shut down properly -- the rest will continue waiting indefinitely.

Rather than pushing some number of empty pointers, hopefully enough to notify
all consumer coroutines, close() the queue. That will notify as many consumers
as there may be.

That means catching LLThreadSafeQueueInterrupt from popBack(), instead of
detecting empty pointer.

Also, if a queued coprocedure throws an exception, coprocedureInvokerCoro()
logs it as before -- but instead of rethrowing it, the coroutine now loops
back to wait for more work. Otherwise, the number of coroutines servicing the
queue dwindles.
2020-03-25 19:25:42 -04:00
Nat Goodspeed fc2437fb5d DRTVWR-476: Introduce LLCoprocedureManager::close(). Use in tests.
The new close(void) method simply acquires the logic from
~LLCoprocedureManager() (which now calls close()). It's useful, even if only
in test programs, to be able to shut down all existing LLCoprocedurePools
without having to name them individually -- and without having to destroy the
LLCoprocedureManager singleton instance. Deleting an LLSingleton should be
done only once per process, whereas test programs want to reset the
LLCoprocedureManager after each test.
2020-03-25 19:07:22 -04:00
Nat Goodspeed bf8aea5059 DRTVWR-476: Use LLThreadSafeQueue, not boost::fibers::buffered_channel.
We've observed buffered_channel::try_push() hanging, which seems very odd. Try
our own LLThreadSafeQueue instead.
2020-03-25 19:07:22 -04:00
Nat Goodspeed b461b5dcef DRTVWR-476: Manually count items in LLCoprocedurePool's pending queue.
Reinstate LLCoprocedureManager::countPending() and count() methods. These were
removed because boost::fibers::buffered_channel has no size() method, but
since all users run within a single thread, it works to increment and
decrement a simple counter.

Add count information and max queue size to log messages.
2020-03-25 19:06:13 -04:00
Nat Goodspeed cc6f1d6195 DRTVWR-476: Use shared_ptr to manage lifespan of coprocedure queue.
Since the consuming coroutine LLCoprocedurePool::coprocedureInvokerCoro() has
been observed to outlive the LLCoprocedurePool instance that owns the
CoprocQueue_t, closing that queue isn't enough to keep the coroutine from
crashing at shutdown: accessing a deleted CoprocQueue_t is fatal whether or
not it's been closed.

Make LLCoprocedurePool store a shared_ptr to a heap CoprocQueue_t instance,
and pass that shared_ptr by value to consuming coroutines. That way the
CoprocQueue_t instance is guaranteed to live as long as the last interested
party.
2020-03-25 19:05:17 -04:00
Nat Goodspeed 26c8ccfc06 DRTVWR-476: Back out changeset 40c0c6a8407d ("final" LLApp listener) 2020-03-25 19:02:24 -04:00
Nat Goodspeed cbf146f2b3 DRTVWR-476: Pump coroutines a few more times when we start quitting.
By the time "LLApp" listeners are notified that the app is quitting, the
mainloop is no longer running. Even though those listeners do things like
close work queues and inject exceptions into pending promises, any coroutines
waiting on those resources must regain control before they can notice and shut
down properly. Add a final "LLApp" listener that resumes ready coroutines a
few more times.

Make sure every other "LLApp" listener is positioned before that new one.
2020-03-25 19:02:24 -04:00
Nat Goodspeed 1345a02b21 DRTVWR-476: Terminate long-lived coroutines to avoid shutdown crash.
Add LLCoros::TempStatus instances around known suspension points so
printActiveCoroutines() can report what each suspended coroutine is waiting
for.

Similarly, sprinkle checkStop() calls at known suspension points.

Make LLApp::setStatus() post an event to a new LLEventPump "LLApp" with a
string corresponding to the status value being set, but only until
~LLEventPumps() -- since setStatus() also gets called very late in the
application's lifetime.

Make postAndSuspendSetup() (used by postAndSuspend(), suspendUntilEventOn(),
postAndSuspendWithTimeout(), suspendUntilEventOnWithTimeout()) add a listener
on the new "LLApp" LLEventPump that pushes the new LLCoros::Stopping exception
to the coroutine waiting on the LLCoros::Promise. Make it return the new
LLBoundListener along with the previous one.

Accordingly, make postAndSuspend() and postAndSuspendWithTimeout() store the
new LLBoundListener returned by postAndSuspendSetup() in a LLTempBoundListener
(as with the previous one) so it will automatically disconnect once the wait
is over.

Make each LLCoprocedurePool instance listen on "LLApp" with a listener that
closes the queue on which new work items are dispatched. Closing the queue
causes the waiting dispatch coroutine to terminate. Store the connection in an
LLTempBoundListener on the LLCoprocedurePool so it will disconnect
automatically on destruction.

Refactor the loop in coprocedureInvokerCoro() to instantiate TempStatus around
the suspending call.

Change a couple spammy LL_INFOS() calls to LL_DEBUGS(). Give all logging calls
in that module a "CoProcMgr" tag to make it straightforward to re-enable the
LL_DEBUGS() calls as desired.
2020-03-25 19:02:24 -04:00